Vonage WhatsApp messages suddenly stopped working - whatsapp

I have recently joined a company that is using Vonage and we have WhatsApp communications which was working fine in both dev and production that have both suddenly stopped working.
The shape of the incoming json looks to have changed significantly, but I have changed the code that is reading this and am able to read the messages into the system.
The problem that I have now, is outgoing message is not being accepted.
If I send this json body over
{
"from": "4474183xxxxx",
"to": "4474719xxxxx",
"message": {
"Type": "text",
"content": "Hello! I’m CAI, A Virtual Chat-bot assistant. blurb, more blurb.... .\n\n1. Okay I understand\n\nChoose any one option. Type \"1\" to choose first option."
}
}
I get the following response
{
"Status": "fail", // custom one to my company
"e3": {
"Error": {
"body": {
"type": "https://developer.vonage.com/api-errors",
"title": "Your request parameters didn't validate.",
"detail": "Found errors validating 1 of your submitted parameters.",
"invalid_parameters": [
{
"name": "to",
"reason": "Malformed JSON body."
}
],
"instance": "cf4bce73-2db5-4102-b7af-xxxxxx"
},
"headers": {
"date": "Wed, 02 Nov 2022 14:02:08 GMT",
"content-type": "application/problem+json",
"content-length": "287",
"connection": "close",
"x-envoy-upstream-service-time": "3",
"x-frame-options": "deny",
"x-xss-protection": "1; mode=block",
"strict-transport-security": "max-age=31536000; includeSubdomains",
"x-content-type-options": "nosniff",
"server": "envoy"
},
"statusCode": 400
},
"StatCode": 400,
"Response": null
},
"a": {
"label": 6,
"trys": [
[
0,
6,
null,
7
]
],
"ops": []
}
}
However, looking at the shape of the message that is on the website (https://dashboard.nexmo.com/messages/sandbox) and send this message
{
"from": "xxxx",
"to": "xxxx",
"message_type": "text",
"text": "Hello! I’m CAI, blurb... .\n\n1. Okay I understand\n\nChoose any one option. Type \"1\" to choose first option.",
"channel" : "whatsapp"
}
I get this response
{
"Status": "fail",
"e3": {},
"a": {
"label": 6,
"trys": [
[
0,
6,
null,
7
]
],
"ops": []
},
"Message": "Cannot read property 'Type' of undefined"
}
I would be grateful if someone could help me shape the message that needs to be sent to vonage to that this can be sent out to the end user \ recipient correct.
Thanks
Simon

Related

Sandbox access token not working [Easyship]

We have to try to integrate Easyship courier API. And We are facing the below issue.
{
"rates": [],
"messages": [
"Sorry, we couldn't find any shipping solutions based on the information provided."
]
}
For more information, I have shared the request parameter and API response.
API URL:- https://api.easyship.com/v2/rates
Request Parameter:
{
"origin_address": {
"postal_code": "91601",
"city": "Los Ángeles",
"state": "CA",
"country_alpha2": "US"
},
"destination_address": {
"postal_code": "95140",
"city": "Mount Hamilton",
"state": "CA",
"country_alpha2": "US"
},
"parcels": [
{
"total_actual_weight": 5,
"items": [
{
"quantity": 1,
"category": "mobile_phones",
"dimensions": {
"width": 10,
"height": 10,
"length": 25
},
"description": "Apple iPad",
"actual_weight": 5,
"declared_currency": "USD",
"declared_customs_value": 49500.55
}
]
}
]
}
Response Parameter:
{
"status": "failure",
"errors": [
"Sorry, we couldn't find any shipping solutions based on the information provided."
],
"request_id": "545b5f76a41e2994a13f384559dee625",
"timestamp": "2022-10-12T10:09:21.272Z"
}
Note:
This request parameter works with the production access token.
We have applied all possible solutions for this issue but didn't find anything.
Also we don't want to use the production access token because we are in the developing stage. so please please provide working with a sandbox solution.

Power Automate HTTP Failure Invalid value for header Content-Language. - Ebay API

Using test listing information I'm trying to send a http put request to eBay using powerautomate. To set up my HTTP action I've followed the API instructions for the createOrReplaceInventoryItem action.
Ebay API Documentation
I continue to get the below error:
{"errors":[{"errorId":25709,"domain":"API_INVENTORY","subdomain":"Selling","category":"REQUEST","message":"Invalid
value for header Content-Language."}]}
I have read many articles where they have suggested changing Content-Language to Accepted-Language but that has not resolved the issue. Another article said to assign it to the HTTPContent instance but I'm unaware how to do this within powerapps.
Link to Suggestion on this thread
Here is the Request:
{
"uri": "https://api.ebay.com/sell/inventory/v1/inventory_item/TestMonkey",
"method": "PUT",
"headers": {
"Authorization": "*sanitized*",
"Content-Language\t": "en_US",
"Content-Type": "application/json",
"X-EBAY-C-MARKETPLACE-ID": "EBAY_US"
},
"body": {
"availability": {
"shipToLocationAvailability": {
"quantity": 50
}
},
"condition": "NEW",
"product": {
"title": "GoPro Hero4 Helmet Cam",
"description": "New GoPro Hero4 Helmet Cam. Unopened box.",
"aspects": {
"Brand": [
"GoPro"
],
"Type": [
"Helmet/Action"
],
"Storage Type": [
"Removable"
],
"Recording Definition": [
"High Definition"
],
"Media Format": [
"Flash Drive (SSD)"
],
"Optical Zoom": [
"10x"
]
},
"brand": "GoPro",
"mpn": "CHDHX-401",
"imageUrls": [
"https://coolbackgrounds.io/images/backgrounds/white/pure-white-background-85a2a7fd.jpg"
]
}
}
How should I configure the Content-Language header value in powerautomate?
Thank you in advance.

Power Automate HTTP Request POST ends with "Internal Server Error"

I'm not sure why I face an "Internal Server Error" when I send an POST Request with Power Automate, but if I send the same request with Postman it works just fine. As you can see the flow tried 4 times until it stopped. I call the same REST API with Postman and it works without problems. The Authorization is by the way Basic with Username and Password.
This is the response from Postman when I send the POST request:
{
"executionTime": 3360,
"hints": [
{
"id": "STRING",
"name": "STRING",
"type": "GROUP_HINT",
"locations": [
{
"tokens": [
{
"start": 33,
"end": 41
},
{
"start": 61,
"end": 66
}
],
"score": 1.0,
"distance": 0,
"groupValue": {
"left": "STRING",
"right": "STRING"
}
}
],
"groupElement": [
"MATCHED GROUPS"
],
"range": 20
}
],
"businessCases": [
{
"businessCaseId": "ee05f8f9-e18d-4bf7-b7db-4c8bc800615a",
"name": "STRING",
"score": 0.53,
"hintCount": 1596,
"originCount": 241,
"matchedHints": [
"MATCHED GROUPS"
],
"matchedBoostedHints": [
"MATCHED GROUPS"
],
"origins": [],
"matchedOrigins": [
"MATCHED GROUPS"
],
"matchedBoostedOrigins": [
"MATCHED GROUPS"
],
"unmatchedOrigins": []
}
],
"questions": [],
"extractedValues": []
}
The REST API should analyse the text in the POST request and return any matched groups through sentiment analysis.

add tracking to mandrill send-template

My mandrill keeps saying my message is not opened when I call messages/info.json despite I have added tracking.
here is my request:
{
"key": "mykey",
"template_name": "message",
"template_content": {},
"message": {
"html": null,
"text": null,
"subject": "test",
"from_email": "info#test.io",
"from_name": "test",
"to": [
{
"email": "rob.proesmans#test.be",
"name": "rob",
"type": "to"
}
],
"headers": null,
"important": null,
"track_opens": true,
"track_clicks": true,
etc..
my mandrill response when i call /messages/info.json
{
"ts": 1455290984,
"_id": "3e5877fc43044841ab505f999b4a5b00",
"state": "sent",
"subject": "test",
"email": "rob.proesmans#redtree.be",
"tags": {},
"opens": 0,
"clicks": 0,
"smtp_events": [
{
"ts": 1455290986,
"type": "sent",
"diag": "250 2.0.0 OK 5E/A9-30218-21AFDB65",
"source_ip": "198.2.134.26",
"destination_ip": "94.143.184.119",
"size": 23062
}
],
"resends": {},
"sender": "info#redtree.io",
"template": "pocmessage",
"opens_detail": {},
"clicks_detail": {}
}
After 5minutes.. still no result after opening the mail..
What am i doing wrong?
Thank you
I takes around 2 hours till Mandrill knows when your mail is opened.

Detect the id of a sent mail

I would like to detect the message-id of an email
sent from the gmail interface?
what are your proposals?
Thanks.
One way of doing it would be to first list messages:
GET https://www.googleapis.com/gmail/v1/users/me/messages
Response:
{
"messages": [
{
"id": "14f60b097be71757",
"threadId": "14f60b097be71757"
},
{
"id": "14f603ead78aff97",
"threadId": "14f603ead78aff97"
}, ...
Then, get the message you want, and just ask for the Message-Id-header:
format = metadata
metadataHeaders = Message-Id
GET https://www.googleapis.com/gmail/v1/users/me/messages/14f60b097be71757?format=metadata&metadataHeaders=Message-Id
Response:
{
"id": "14f60b097be71757",
"threadId": "14f60b097be71757",
"labelIds": [
"INBOX",
"CATEGORY_PROMOTIONS",
"UNREAD"
],
"snippet": "Cool snippet...",
"historyId": "545168",
"internalDate": "1440436229000",
"payload": {
"mimeType": "multipart/alternative",
"headers": [
{
"name": "Message-Id",
"value": "<10342275.20150824171029.55db500501e9a7#example.com>" // Here it is!
}
]
},
"sizeEstimate": 73995
}