Instagram: invalid message data error while trying to send pushback buttons - facebook-messenger

Using https://graph.facebook.com/v13.0/me/messages?access_token=pagetoken post url trying to send pushback buttons. But its gives error as:
"message": "(#100) Invalid message data",
"type": "OAuthException",
"code": 100,
"error_subcode": 2534015
**Request-body:**
{
"recipient":{
"id":"PSID"
},
"message":{
"attachment":{
"type":"template",
"payload":{
"template_type":"button",
"text":"Try the postback button!",
"buttons":[
{
"type":"postback",
"title":"Postback Button",
"payload":"DEVELOPER_DEFINED_PAYLOAD"
}
]
}
}
}
}

This one is not supported by instagram anymore, try generic type with post back button https://developers.facebook.com/docs/messenger-platform/instagram/features/generic-template

Related

Overseer sending a blank message on discord when new movie / Tv has been added to plex

I have overseerr set up to send a message on discord when a movie / Tv show is available on plex. A few months back it stopped working, just had not had time to look into it. This is the default json in overseerr
{
"notification_type": "{{notification_type}}",
"event": "{{event}}",
"subject": "{{subject}}",
"message": "{{message}}",
"image": "{{image}}",
"{{media}}": {
"media_type": "{{media_type}}",
"tmdbId": "{{media_tmdbid}}",
"tvdbId": "{{media_tvdbid}}",
"status": "{{media_status}}",
"status4k": "{{media_status4k}}"
},
"{{request}}": {
"request_id": "{{request_id}}",
"requestedBy_email": "{{requestedBy_email}}",
"requestedBy_username": "{{requestedBy_username}}",
"requestedBy_avatar": "{{requestedBy_avatar}}"
},
"{{issue}}": {
"issue_id": "{{issue_id}}",
"issue_type": "{{issue_type}}",
"issue_status": "{{issue_status}}",
"reportedBy_email": "{{reportedBy_email}}",
"reportedBy_username": "{{reportedBy_username}}",
"reportedBy_avatar": "{{reportedBy_avatar}}"
},
"{{comment}}": {
"comment_message": "{{comment_message}}",
"commentedBy_email": "{{commentedBy_email}}",
"commentedBy_username": "{{commentedBy_username}}",
"commentedBy_avatar": "{{commentedBy_avatar}}"
},
"{{extra}}": []
}
In the logs, I see this error code 400 and 50006
Can anyone advise on how to fix the code? Many thanks

Delete label request returning 400 even though label exists

I am having issues with the label delete Gmail API.
No matter what label I submit, I get the error response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid delete request"
}
],
"code": 400,
"message": "Invalid delete request"
}
}
To reproduce, I first make the request:
POST https://www.googleapis.com/gmail/v1/users/me/labels
{"labelListVisibility":"labelShow","messageListVisibility":"show","name":"C2"}
Which succeeds and then immediately after I send:
DELETE https://www.googleapis.com/gmail/v1/users/me/labels/C2
Which produces the aforementioned error. I can see the label in my gmail inbox so I know it is successfully created and present. Any advice on what I am doing wrong?
You cannot delete a label by name, but must do so by its ID
See here. The Id of the label is contained in the response of the
POST https://www.googleapis.com/gmail/v1/users/me/labels
request:
{
"id": "Label_3",
"name": "C1",
"messageListVisibility": "show",
"labelListVisibility": "labelShow"
}
You can also list all you labels to retrieve their IDs.
The delete request should look something like:
DELETE https://www.googleapis.com/gmail/v1/users/me/labels/Label_3
whereby Label_3 should be replaced by your label ID.

How i can dynamic my flash message in angular. message must be coming through API response

My flash message code is below
<div class="flash-message" ng-if="flash">
<div class="{{'alert alert-' + flash.type}}" ng-bind="flash.message">
</div>
Right now i am using
FlashService.Success('You have blocked this User');
I want to make my above message dynamic, i have passed static right now.
My node api is return this message right now
{
"data": {
"status": "1",
"msg": "You have blocked the user"
}
}
Pass the result in function callback.
{
"data": {
"status": "1",
"msg": "You have blocked the user"
}
}
Put the below code to make flash Message dynamic.
FlashService.Success(result.data.msg);

There was a issue with the requested skill's response when using Alexa Simulator but works with Manual JSON

I am having a few issues with my new created alexa skills.
Typing the request in the text box in Alexa Simulator always returns "There was a problem with the requested skill's response". With the output JSON bellow.
{
"body":{
"version":"1.0",
"response":{
"outputSpeech":{
"type":"PlainText",
"text":"Hello i am here"
},
"card":{
"type":"Simple",
"title":"Welcome",
"content":"Hello i am here"
},
"directives":[
{
"type":"Display.RenderTemplate",
"template":{
"type":"BodyTemplate2",
"token":"",
"backgroundImage":{
"contentDescription":"Description for the background image",
"sources":[
{
"url":"URL for the background image - must be secure (https)",
"size":"x-small",
"widthPixels":0,
"heightPixels":0
}
]
},
"image":{
"contentDescription":"Description for the main image",
"sources":[
{
"url":"URL for the main image - must be secure (https)",
"size":"x-small",
"widthPixels":0,
"heightPixels":0
}
]
},
"title":"Welcome",
"textContent":{
"primaryText":{
"type":"RichText",
"text":"Welcome"
},
"secondaryText":{
"type":"RichText",
"text":"Hello i am here"
}
},
"backButton":"HIDDEN"
}
}
],
"shouldEndSession":false
},
"sessionAttributes":{
}
}
}
However, when i copy the JSON input from the request about and user Manual JSON to test, it works perfectly well but returns a slightly different JSON Format
{
"status":"SUCCESSFUL",
"result":{
"skillExecutionInfo":{
"invocationRequest":{
"endpoint":"url here",
"body":{
"version":"1.0",
"session":{
"new":true,
"sessionId":"amzn1.echo-api.session.b62b79ba-1dde-4b22-9bf5-492943a008bc",
"application":{
"applicationId":"amzn1.ask.skill.7c4d08db-82be-4e18-9a62-7a95c58dd69f"
},
"user":{
"userId":"amzn1.ask.account."
}
},
"context":{
"AudioPlayer":{
"playerActivity":"IDLE"
},
"Display":{
},
"System":{
"application":{
"applicationId":"amzn1.ask.skill.7c4d08db-82be-4e18-9a62-7a95c58dd69f"
},
"user":{
"userId":"amzn1.ask.account."
},
"device":{
"deviceId":"amzn1.ask.device.",
"supportedInterfaces":{
"AudioPlayer":{
},
"Display":{
"templateVersion":"1.0",
"markupVersion":"1.0"
}
}
},
"apiEndpoint":"https://api.amazonalexa.com",
"apiAccessToken":"eyJ0eXAiOiJKV1"
}
},
"request":{
"type":"LaunchRequest",
"requestId":"amzn1.echo-api.request.",
"timestamp":"2018-02-05T11:35:53Z",
"locale":"en-GB"
}
}
},
"invocationResponse":{
"body":{
"response":{
"card":{
"type":"Simple",
"title":"Welcome",
"content":"Hello i am here"
},
"directives":[
{
"template":{
"type":"BodyTemplate2",
"token":"",
"title":"Welcome",
"textContent":{
"primaryText":{
"type":"RichText",
"text":"Welcome"
},
"secondaryText":{
"type":"RichText",
"text":"Hello i am here"
}
},
"backButton":"HIDDEN",
"backgroundImage":{
"contentDescription":"Description for the background image",
"sources":[
{
"url":"URL for the background image - must be secure (https)",
"size":"X_SMALL",
"widthPixels":0,
"heightPixels":0
}
]
},
"image":{
"contentDescription":"Description for the main image",
"sources":[
{
"url":"URL for the main image - must be secure (https)",
"size":"X_SMALL",
"widthPixels":0,
"heightPixels":0
}
]
}
},
"type":"Display.RenderTemplate"
}
],
"outputSpeech":{
"type":"PlainText",
"text":"Hello i am here"
},
"shouldEndSession":false
},
"sessionAttributes":{
},
"version":"1.0"
}
},
"metrics":{
"skillExecutionTimeInMilliseconds":254
}
},
"error":null
}
}
Any idea what the problem could be thanks.
For any one that comes across this question with the same problem. If the response includes the Display.RenderTemplate directive, make sure that display interface is enabled on the Alexa developer console.
From the Alexa developer console on your skill, navigate to Interfaces and make sure Display Interface is enabled.

Receiving "Invalid 'changeType'" when subscribing to user created event

I am trying to create a Webhook (aka Subscription) for users who are created, updated, or deleted in Office 365.
With the "changeType": "updated" it works fine but with "changeType": "created" it returns an error:
This is the request:
{
"changeType": "created,updated,deleted",
"notificationUrl": "https://ourLink",
"resource": "users",
"expirationDateTime": "2017-12-16T14:49:57Z",
"clientState": "pe1g9gqiVsE6KnHTUuK9Tts3o660KOAw9YnavVfKhr22I7FlqC0tfMhpayxrqFP4orFPOjK0rppYtDicvxZosbvOEEgfy3YYoM3FGDwLQiW4MAdSCTdQkffuChjmB"
}
Error:
{
"header": 400,
"body": {
"error": {
"code": "InvalidRequest",
"message": "Invalid 'changeType' attribute: 'created'.",
"innerError": {
"request-id": "74454900-d3df-4962-b58e-cfd7ec7454bc",
"date": "2017-12-13T16:49:59"
}
}
}
}
Creating a subscription to a user resource is only available in the Beta API
but according to the documentation, it should work.
Based on the error message and that the User Webhook sample application only handles updated and deleted, this should be the expected behavior.
I'm also unable to find where in the documentation it states that a user resource accepts subscriptions for created. If you could provide a link I will make sure the documentation gets updated.

Resources