Why is my whatsapp message not being sent? - whatsapp

Testing with Postman, I'm trying to send a message per the glitch example project from docs
I'm trying to write an API endpoint I can hit with a webhook when people send a message to my Org's whatsapp number. The API would send an automated response.
When I send the POST, with the following body to https://graph.facebook.com/v14.0/redacted/messages it comes back with the following response:
{
"error": {
"message": "(#131030) Recipient phone number not in allowed list",
"type": "OAuthException",
"code": 131030,
"error_data": {
"messaging_product": "whatsapp",
"details": "Recipient phone number not in allowed list: Add recipient phone number to recipient list and try again."
},
"error_subcode": 2655007,
"fbtrace_id": "A5YKQbpB0PEaaA-gIROEv-n"
}
}
The error code isn't list one the error codes page, nor can I find anything about adding a recipient phone number anyway (it doesn't make sense to require a pre-defined list of recipient phone numbers to which I can send messages).
Here's the message body:
{
"messaging_product": "whatsapp",
"to": "redacted",
"text": {
"body": "Ack: Hello world"
}
}
How do I get the message sent? I'm not able to proceed with development of my app until I can send a message.

Just Remove + from your mobile number and add you country code before your number.
Then its working fine.
Request Body:
{
"messaging_product": "whatsapp",
"to": "91xxxxxxxxxx",
"type": "template",
"template": {
"name": "hello_world",
"language": {
"code": "en_US"
}
}
}
Response Body:
{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "91xxxxxxxxxx",
"wa_id": "91xxxxxxxxxx"
}
],
"messages": [
{
"id": "wamid.HBgMOTE3NTM4OTE4MzIyFQIAERgSOERCM0ZDOTJFMDk1RjBFNURBAA=="
}
]
}
for Your Reference

I got the same error code and message here.
I was debugging it and see that the from number is a little different than the number I had registered when I will echo the message back.
You can put the number of phone hard coded that you have registered before to see it working.

Related

whatsapp cloud template not allowing line break in variable text

Im trying to send a whatsapp message using cloud api
I created a template in whatsapp cloud for simple text ie without header and footer, I added only body with one parameter like
hi {{1}}
.. ..
This template is valid and able to send message without line break in message ie(in variable part from postman)
My payload from postman is
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "{{message_to}}",
"type": "template",
"template": {
"name": "simple_text_only",
"language": {
"code": "en_US"
},
"components": [
{
"type" : "body",
"parameters": [
{
"type": "text",
"text": "HIIIIII\nok"
},
]
}
]
}
}
Response is
{
"error": {
"message": "(#100) Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_data": {
"messaging_product": "whatsapp",
"details": "Param text cannot have new-line/tab characters or more than 4 consecutive spaces"
},
"error_subcode": 2494073,
"fbtrace_id": "Av68Tbsx7_vCLzDzf7RUR"
}
}
if i send message without \n then it is sending, but i want to send the message in next line like
1 some text
2 some text

How to send a activity feed notification with a query on Teams?

I've been developing a Teams Custom App with the TeamsFx SDK. I want to send a activity feed notification with a query.
I tried the HTTP request as below, however the app wasn't able to recieve a query(hoge=123).
POST https://graph.microsoft.com/v1.0/users/{user id}/teamwork/sendActivityNotification
Content-Type: application/json
{
"topic": {
"source": "entityUrl",
"value": "https://graph.microsoft.com/v1.0/users/{user id}/teamwork/installedApps/{installation id}?hoge=123"
},
"activityType": "taskCreated",
"previewText": {
"content": "New Task Created"
},
"templateParameters": [
{
"name": "taskId",
"value": "Task 12322"
}
]
}
Is there any wat to send a activity feed notification with a query?

whatsapp api error during sending an created template

{ "messaging_product": "whatsapp",
"to": "91********5",
"type": "template",
"template": {
"name": "demo_template",
"language": {
"code": "en_US"
}
}
}
This is passed as a post method.
demo_template is an existing template created by me.
Getting error like this:
{
"error": {
"message": "(#132012) Parameter format does not match format in the created template",
"type": "OAuthException",
"code": 132012,
"error_data": {
"messaging_product": "whatsapp",
"details": "header: Format mismatch, expected IMAGE, received UNKNOWN"
},
"error_subcode": 2494073,
"fbtrace_id": "ARtWScjGa0rADjfHvbOH4bS"
}
}
For image you have to first upload the image in media library then you can get id for the media you have uploded then you can attach that id with the messaging template you send out in headers in your case it is image.check this link here
or you can directly use url link to attach media.{ "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://URL" } } ] },
The parameter values included in the request are not using the format specified in the template. See the Message Template Guidelines.

SkillsFuture Credit Pay Not working properly

We are using the API /skillsFutureCredits/claims/encryptRequests with the following payload
{
"claimRequest": {
"course": {
"id": "TGS-2020002051",
"fee": "1.00",
"runId": "278849",
"startDate": "2022-04-28"
},
"individual": {
"nric": "T5001077A",
"email": "abc#abc.com",
"homeNumber": "87654321",
"mobileNumber": "12345678"
},
"additionalInformation": "any additional information"
}
}
We get the encrypted response back and run /skillsFutureCredits/claims/decryptRequests with the following payload
{ "claimRequestStatus": "eyJ2IjoiIiwiaXYiOiJ4eS9XTGdiM3l2cHNEK1VENzh3TVFBa1BSWGpHSzhzbmJ0QUI4YUlTZmtNPSIsImtleXMiOnsiZGQ6YTk6YzM6NGY6Yzk6YWQ6OTY6NjQ6ZDc6YWQ6NDY6M2Q6ZDE6YmI6OGM6MDQ6Y2E6OGY6YzA6MWUiOiJWWnN1d2xacGtZdEdKZEtnV3dMblJxMGNmN1ZwK3ZXbjcvWFhEOG5TdVBJMGpRRkFIRG0vaUM5ejRPTEt4ODhST21pQ1p3WEVXU2NHd0lod2htMnBvM0ExMEdYZy80eWdDVEJhNkI1NVQ1TmdvWmlGTS9LWlBVRHFoVzFrUXQ3alB3anlTZm81Z0M5a0JtSnJDbXlJZ05veXFQV2RPcytBQ0J2SHgrUGVqT1d3T2trYThJbm9LS2NqenhHV2hKbWpoWEl2ZFM3aDUwdE10TmJQMk5wbTdvZWROeUl1OWw0Ty9BV3FWQmtYVGY2ZFRvb2J5OFJsM2JJcHhFQmp6Qy9pYzZBN3N5OGFrZDQ4Znk4WWhyTngvdXpDZ0NENVl0bElHSmFpYmt5bm55ZWNBS1NEbFdqMnNlOGdsbmdFNUZCa0hCZjdmWDVuU2VydXdmRDl4Q1MrbnRSYU5Yc3NweHJ2bE9sMmpWN0l1dENId2JvNmRnS3laMVRDSXc0Q2tta2tuY1VrcWluZk5nNjBHaFNOTXI3aGlUWmg4RnNESkJ4TmEzMFRpY1IvNExtTGdncFNyKy9HdDRweW1WTitiUDRuQ0o4QSt1L0VuVEJOcnEzZ3RCczVkYmMzdjdhT3BQTXMyTHIvK2RtdENDTEVWNWpZUkVsZDM5ZkVVd1lXUVZZOW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xcueQyQbC4qq/JWX7o7Pe0OeKUSYIMT/0xaPD19yOOyxuY0y+LWDhV9VP4oTFIGM/2hhoJRuLfGwVevQdQsRh3XLfcpPccO4Xer4D2KelIFACofkn0goY1"
which when decrypt, it is an empty data. In post man, it is showing 500 internal server error but not showing us what error it is.
Any help is greatly appreciated.

Update Account (PUT) Endpoint in new Yodlee API for MFA

Background
I am using the newer Yodlee Aggregation API that differs from what I was previously building off of.
I am currently using this endpoint in the account registration flow to put the MFA response:
PUT /{cobrandName}/v1/providers/{providerAccountId}
My request looks like this:
{
url: `${this.rest}providers/${providerAccountId}`,
headers: {
'Authorization': `cobSession=${self.appToken}, userSession=${token}`
},
form: {
'MFAChallenge': JSON.stringify(newMfa)
}
}
where this.rest is my personal rest url, providerAccountId is the appropriate providerAccountId for the refresh, self.appToken is the current cobrand session token, token is the current user's login token, and newMfa is a JSON object being stringified that matches this profile:
{
"loginForm": {
"mfaTimeout": 94650,
"formType": "questionAndAnswer",
"row": [
{
"id": "SQandA--QUESTION_1--Row--1",
"fieldRowChoice": "0001",
"form": "0001",
"label": "What is the name of your state?",
"field": [
{
"id": "SQandA_QUESTION_1_1",
"name": "QUESTION_1",
"isOptional": false,
"value": "Enter the answer",
"valueEditable": true,
"type": "text"
}
]
},
{
"id": "SQandA--QUESTION_2--Row--2",
"fieldRowChoice": "0001",
"form": "0001",
"label": "What is the name of your first school",
"field": [
{
"id": "SQandA_QUESTION_2_2",
"name": "QUESTION_2",
"isOptional": false,
"value": "Enter the answer",
"valueEditable": true,
"type": "text"
}
]
}
]
}
with the exeption being the value fields of the field object, which have been encrypted with PKI as per instructions.
Issue
However, when I carry out this PUT request, I get this error from Yodlee:
{ errorCode: 'Y803',
errorMessage: 'MFAChallenge or providerParam required',
referenceCode: 'p1460412835654A4Q24t' }
though I clearly have an MFAChallenge parameter in my form. Any ideas on why I could be getting this error if the MFAChallenge is present (and note that it is the only info that is passed through the PUT request other than through headers or url parameters)? I tried putting it through as body data, but that doesn't seem to work, and very few of the API endpoints actually seem to use body over form encoded strings, though there was at least one.
You have to send this information MFAChallenge as part of URL, see below example
https://developer.api.yodlee.com/ysl/restserver/v1/providers/10114184?MFAChallenge=%7B%20%22loginForm%22%3A%20%7B%20%20%20%20%20%22mfaTimeout%22%3A%2094650%2C%20%20%20%20%20%22formType%22%3A%20%22questionAndAnswer%22%2C%20%20%20%20%20%22row%22%3A%20%5B%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22SQandA--QUESTION_1--Row--1%22%2C%20%20%20%20%20%20%20%20%20%22fieldRowChoice%22%3A%20%220001%22%2C%20%20%20%20%20%20%20%20%20%22form%22%3A%20%220001%22%2C%20%20%20%20%20%20%20%20%20%22label%22%3A%20%22What%20is%20the%20name%20of%20your%20state%3F%22%2C%20%20%20%20%20%20%20%20%20%22field%22%3A%20%5B%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22SQandA_QUESTION_1_1%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22QUESTION_1%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22isOptional%22%3A%20false%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22value%22%3A%20%22Enter%20the%20answer%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22valueEditable%22%3A%20true%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%20%20%20%20%20%20%20%20%5D%20%20%20%20%20%7D%2C%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22SQandA--QUESTION_2--Row--2%22%2C%20%20%20%20%20%20%20%20%20%22fieldRowChoice%22%3A%20%220001%22%2C%20%20%20%20%20%20%20%20%20%22form%22%3A%20%220001%22%2C%20%20%20%20%20%20%20%20%20%22label%22%3A%20%22What%20is%20the%20name%20of%20your%20first%20school%22%2C%20%20%20%20%20%20%20%20%20%22field%22%3A%20%5B%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22id%22%3A%20%22SQandA_QUESTION_2_2%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22name%22%3A%20%22QUESTION_2%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22isOptional%22%3A%20false%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22value%22%3A%20%22Enter%20the%20answer%22%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22valueEditable%22%3A%20true%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22text%22%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20%20%20%20%20%20%20%20%20%5D%20%20%20%20%20%7D%20%5D%20%7D