Cant get my Jason code for api work and cant figure out - sirishortcuts

I get this error when I try to create my shortcut for creating a new page in a database in Notion:
{
"status":400,
"object":"error",
"code": "invalid_json",
"message":"Error parsing JSON body."
}
This is my code:
​​{
"parent": {
"database_id": "key"
},
"properties": {
"Name": {
"title": [{"Provided Input"}]
},
"Status": {
"status": [{"Chosen Item"}]
},
"For who?": {
"forwho": [{"Chosen Item}]
}
}
}
I tried all the solutions I found, but I still get the same error.
I would really appreciate if anyone could help, thanks.
(I have no coding background, mostly used JASON app and Shortcuts app)

Related

Unable to Launch Alexa Hosted Skill which was created using Fact Skill template

Unable to Launch Alexa Hosted Skill which was created using Fact Skill template. This is a custom skill written in Python. I haven't changed any code except the class name of Launch Request handler.
class GetNewQuestionHandler(AbstractRequestHandler)
Above mentioned class is supposed to handle the Launch request, however request doesn't hit this code as I don't see any log printed from this class. CatchAllExceptionHandler also doesn't print any log.
Intent handlers and exception handlers are registered like this:
sb.add_request_handler(GetNewQuestionHandler())
sb.add_exception_handler(CatchAllExceptionHandler())
Here is the response json -
{
"header": {
"namespace": "SkillDebugger",
"name": "CaptureError",
"messageId": ""
},
"payload": {
"code": "SKILL_ENDPOINT_ERROR",
"description": "Skill execution returned an exception for requestId abcd",
"debuggingInfo": {
"type": "SkillExecutionInfo",
"content": {
"invocationRequest": {
"body": {
"version": "1.0",
"session": {
},
"context": {},
"request": {
"type": "SessionEndedRequest",
"reason": "ERROR",
"error": {
"type": "INTERNAL_SERVICE_ERROR",
"message": "Can't find skill bundle metadata for skillId abc locale xyz stage development"
}
}
}
}
}
}
}
}
Please let me know what is the issue with this skill.
Note: Please let me know in case any other info is required.

Microsoft Graph API UnableToDeserializePostBody 400 error

I'm trying to create recurring events under my outlook calendar and for that, I'm following instructions from here.
My payload looks like this:
{
"Subject": "Blocked By DEV",
"Body": {},
"Start": {
"DateTime": "2022-08-30T23:30:00",
"TimeZone": "Asia/Calcutta"
},
"End": {
"DateTime": "2022-08-30T23:45:00",
"TimeZone": "Asia/Calcutta"
},
"Recurrence": {
"pattern": {
"type": "WEEKLY",
"interval": 1,
"daysOfWeek": [
"Monday",
"Tuesday"
]
},
"range": {
"type": "numbered",
"startDate": "2022-08-30",
"numberOfOccurences": 3
}
}
}
I'm trying to hit the endpoint /me/events from Graph Explorer and getting this 400 error.
{
"error": {
"code": "UnableToDeserializePostBody",
"message": "were unable to deserialize "
}
}
Is there anything wrong with my payload? Is there any way to have more details about the failure?
Just spotted the culprit, numberOfOccurences was supposed to be numberOfOccurrences.
And if someone asks why I ended up doing that mistake, I just referred docs, and seems like official documentation has that typo.

MS Teams not accepting task module payload

while trying to use the developer preview tasks module i got a strange issue.
Teams isn't showing my module, always telling me this in console:
<BotError>Error when processing invoke response: Payload is incorrect, field is in the wrong format: task.value
What I'm sending is this:
{
"task": {
"value": {
"url": "https://<ourbaseserviceurl>",
"title": "Microsoft Ignite 2018 Vision Keynote",
"height": 700,
"width": 1000,
"fallbackUrl": "<ourbaseserviceurl"
},
"type": "message"
}
}
Was trying to use the sample but even that doesn't seem to work properly atm.
The URL is in allowedurls for the app and the same we use to communicate with the bot which is in general working fine.
Please set the task type as continue while passing TaskInfo object. Here is the
documentation.
{
"task": {
"type": "continue"
"value": {
"url": "https://<ourbaseserviceurl>",
"title": "Microsoft Ignite 2018 Vision Keynote",
"height": 700,
"width": 1000,
"fallbackUrl": "https://<ourbaseserviceurl>"
},
}
}
Here is how you display the value in a popup message box:
{
"task": {
"type": "message",
"value": "Message text"
}
}
Please try and let us know if you face any issue.

Crm Update productsubstitutes gets 502 error within logic app

I am trying to update existing productsubstitutes entities in Dynamics CRM Online within a Logic App.
I make lookups on the products that should be linked and than use the connector to send the following data:
{
"host": {
"connection": {
"name": "/subscriptions/XXXX/resourceGroups/XXX/providers/Microsoft.Web/connections/dynamics_crm_dev"
}
},
"method": "patch",
"path": "/datasets/XXX.crm4/tables/productsubstitutes/items/ITEMID",
"retryPolicy": {
"type": "None"
},
"body": {
"ItemInternalId": "ITEMID",
"_productid_value": "1f2017c1-b9e8-40db-9e15-c890b127e7b2",
"_salesrelationshiptype_label": "Interchangeable",
"_substitutedproductid_value": "4e1d1dd7-b9e8-40db-9e15-c890b127e7b2",
"direction": 0,
"productsubstituteid": "839229d1-b9e8-40db-9e15-c890b127e7b2",
"interchangability": 928350000,
"type": 928350000
}
This results in the strange error message:
"statusCode": 502,
"headers": {
XXX
},
"body": {
"error": {
"code": 502,
"source": "logic-apis-westeurope.azure-apim.net",
"clientRequestId": "XXXX-XXX-4b5c-a4d5-XXXX",
"message": "BadGateway",
"innerError": {
"status": 502,
"message": "The other row for the product relationship is not available.",
"source": "XXXX.crm4.dynamics.com",
"errors": [],
"debugInfo": "XXXX-XXX-4b5c-a4d5-XXXX"
}
}
}
Both product IDs: 4e1d1dd7-b9e8-40db-9e15-c890b127e7b2 and 1f2017c1-b9e8-40db-9e15-c890b127e7b2 are correct and where obtained via lookups before the update requests.
This problem is reproducible, and as it looks its only happening on particular products.
Edit:
I rebuilt the update within a small C# component with the XRM SDK and I am getting the same error.
So its definitely crm related.
Edit2:
I have a MS ticket open they are aware of the issue.. and will come back on it on the 23.08 days.

How to send a mail with mention?

When I get mails:
GET /beta/me/messages
I can check this to see if someone mentioned me.
mentionsPreview: {
isMentioned: true
}
How can I send out a mail and mention someone or some people in the mail?
I didn't find any info in the document.
UPDATE 1:
I can successfully add mentions when create a new mail and send out by
POST /beta/me/sendMail
{
// ...
"mentions":[{
"mentioned": {
"name": "Jack",
"address": "jack#example.com"
},
"createdBy": {
"name": "Me",
"address": "me#example.com"
}
}]
}
However, I failed to add mentions when reply a mail. I create a draft first by
POST /beta/me/messages/{messageId}/createReplyAll
Then I update it by (this step failed to add mentions)
PATCH /beta/me/messages/{messageId}
{
"body": {
"contentType": "html",
"content": "hi"
},
"mentions":[{
"mentioned": {
"name": "Jack",
"address": "jack#example.com"
},
"createdBy": {
"name": "Me",
"address": "me#example.com"
}
}]
}
I send it out by
POST /beta/me/messages/{messageId}/send
In the mail Jack got, the content successfully updated. But mentionsPreview is still null.
UPDATE 2:
Thanks Jason's help.
Further test, I succeed add mention by
POST /beta/me/messages/{messageId}/mentions
{
"mentioned": {
"address": "jack#example.com"
}
}
But I failed to add mentions using array
POST /beta/me/messages/{messageId}/mentions
{
"mentions":[{
"mentioned": {
"address": "jack#example.com"
}
}]
}
which means I have to POST mentions one by one at least for now.
https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/mention
When creating a message, an app can create a mention in the same POST request by including the mention in the mentions property.
UPDATE
On your new question about doing this on a reply, the problem is you cannot PATCH in mentions like that. You can only include mentions inline with the rest of the message if you do it at message creation. Since you've already created the message (via the createReplyAll method), to update mentions you need to POST new mentions to the /mentions relationship on the message, like:
POST /me/messages/{messageId}/mentions
{
"mentioned": {
"name": "Jack",
"address": "jack#example.com"
},
"createdBy": {
"name": "Me",
"address": "me#example.com"
}
}
As an interesting side note, you CANNOT currently include mentions inline using the replyAll method. It seems that you can only do this when creating a brand new message or when sending a new message. For all other cases, you need to do a POST to the /mentions relationship as above.

Resources