[twilio]Getting empty Body using Fetch Message API - sms

I am using Fetch message API to get the SMS details but for outbound messages I am getting empty body -https://api.twilio.com/2010-04-01/Accounts//Messages/.json
{
"body": "",
"num_segments": "1",
"direction": "outbound-api",
"from": "+XXXXXX",
"date_updated": "Wed, 19 Oct 2022 23:44:34 +0000",
"price": "-0.00225",
"error_message": null,
Even tried seeing message body in Twilio console there also it is shown empty though I have got message on my phone.
enter image description here

Related

Send Conversation History API returning HTTP 400 BotFramework

I'm trying to sendConversation History API provided by Microsoft in BotFramework Documentation. It takes Transcript object (array of activities) as the input. But I've getting HTTP 400 Bad Request when using trying that.
I'm making a POST request on this and authenticating it using JWT Token generated by client credentials for the bot.
https://directline.botframework.com/v3/conversations/HBoZPkTiBYOAadigqEqFaJ-us/activities/history
This is the error I get.
{
"error": {
"code": "BadSyntax",
"message": "Invalid or missing activities"
}
}
This is the activity array payload that I'm using
[
{
"type": "message",
"id": "HBoZPkTiBYOAadigqEqFaJ-us|0000003",
"timestamp": "2022-09-05T08:10:00.3574378Z",
"localTimestamp": "2022-09-05T13:39:57.633+05:30",
"localTimezone": "Asia/Calcutta",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "dl_uID1",
"name": "userName"
},
"conversation": {
"id": "HBoZPkTiBYOAadigqEqFaJ-us"
},
"recipient": {
"id": "bot-name-dev#abcd",
"name": "bot-name-dev"
},
"textFormat": "plain",
"locale": "en-GB",
"text": "hi",
"channelData": {
"clientActivityID": "1662365337633rmq6e8mbm09",
"clientTimestamp": "2022-09-05T08:09:57.633Z"
}
}
]
I'm not able to figure out what's the correct format of activity object that it is expecting.
Create the bot and get it connected to the Direct Line. Get the secret keys of the site that need to connect.
Before calling SendConversationHistory if the message is delivered to the recipient, it will create the bad request error message as it is unable to get the conversation history as the message was already received. SendConversationHistory must be called before sending the message then the Conversation History will be tracked. The below screens will be helpful to create the DirectLine connection to the bot created. Then needed to add the trusted sites to DirectLine. Then proceed with the code sample mentioned below which takes the conversation history.
Click on Create a resource
Search for bot and click on create
Select Channels
Get the App Service Extension Keys and click on Default_site
Click on the toggle and enable the enhanced authentication options and add the website which we need to communicate.
In the code block of the current working application, to get the conversation history, use the following code block.
foreach (var a in activities)
{
incrementId++;
// Use your own ID format
a.Id = string.Concat("history|", incrementId.ToString().PadLeft(7, '0'));
a.ChannelData = null;
a.Conversation = new ConversationAccount(id: convId);
if (a.From.Name == message.Recipient.Name)
{
// Bot to recipient connection
a.Recipient = message.From;
a.From = message.Recipient;
}
else
{
// User to bot connection (here bot will be the recipient)
a.Recipient = message.Recipient;
a.From = message.From;
}
}
After connecting with Microsoft, I found this is the correct payload for this API.
{
"activities": [
{
"type": "message",
"id": "whatever-conversation-id-in|0000000",
"timestamp": "2022-11-20T20:14:26.242902Z",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"id": "dl_test_id",
"name": ""
},
"conversation": {
"id": "whatever-conversation-id-in"
},
"recipient": {
"id": "ABC_bot",
"name": "ABC_bot"
},
"text": "Hello Bot"
}
]
}

Timezone shows UTC in Outlook when created by graph api

When creating an calendar event via MS Graph API the event looks different in the OWA and the Outlook Client.
In the Outlook client the event shows up ok in the overview, but when looking at the details it is shown in UTC instead of my timezone (Western Europe) and I cannot click/unclick the timezone button. If I open the same event in OWA it shows up in the correct timezone. Also if I send the event to another organisation it also shows up ok.
This leads me to believe it's something in our outlook client, but then I cannot see any difference in the graph API between events created from Outlook directly (looks ok) and the ones created via a rest call.
This is my payload
{
"subject": "tEST",
"organizer": {
"emailaddress": {
"address": "<email>"
}
},
"start": {
"dateTime": "2019-10-09T08:01:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2019-10-09T09:01:00.0000000",
"timeZone": "UTC"
},
"attendees": [
{
"emailAddress": {
"name": "Mattias Johansson",
"address": "<email>"
},
"type": "optional"
}
],
"reminderminutesbeforestart": 15
}
and this is a screenshot of the booking, the time is slightly different since it's another booking than the payload.

Trustpilot invitation api weird result

Trying to create invitations using their API, I get a proper result back, however the status is "notsent". There is zero debug information to go by, so I'm wondering if anyone else has seen this and might have ideas for fixing the issue.
Here's an example of a response I got from their api:
{
"businessUnitId": "<business unit id here>",
"businessUserId": "<business user id here>",
"createdTime": "2018-10-02T09:58:35.135569Z",
"id": "<invitation id here>",
"locale": "da-DK",
"preferredSendTime": "2018-10-09T09:58:34Z",
"recipient": {
"email": "<email goes here>",
"name": "<name goes here>"
},
"redirectUri": "http://trustpilot.com",
"referenceId": "<our ref id>",
"replyTo": "trustpilot#boozt.com",
"sender": {
"email": "noreply.invitations#trustpilotmail.com",
"name": "Booztlet.com"
},
"sentTime": null,
"source": "InvitationApi",
"status": "notsent",
"tags": [],
"templateId": "57cfc1a660e1cc0620b53a38"
}
So, the NotSent status code is expected for new invitations. This is because invitations are sent asynchronously - at around the time you put in as your "preferredSendTime".
If you login to your account at https://businessapp.b2b.trustpilot.com/#/invitations/invitation-history, you should be able to see the invitation you created, and whether it was sent or not (since you specified October 9th as your preferredSendTime, the invitation will still be queued until that point)

Mandrill emails stuck in queued

I managed to figure out how to send emails via Mandrill and Parse Cloud Code with Back4App. When checking the API logs for Mandrill I see the following:
Full Request
{
"message": {
"text": "asdf Email Test",
"subject": "adsf Email Test",
"from_email": "no-reply#asdf.ca",
"from_name": "Site",
"to": [
{
"email": "myemail#gmail.com",
"name": "Martin",
"type": "to"
}
],
"headers": {
"Reply-To": "no-reply#adsf.ca"
}
},
"async": false,
"ip_pool": "Main Pool",
"send_at": "2018-03-13T17:14:41.645Z",
"key": "oc7ueJMLRGgaEDrjhk5DBg"
}
Full Response
[
{
"email": "myemail#gmail.com",
"status": "queued",
"_id": "7c28e80e4de1405f93d1d096600128d4",
"reject_reason": null
}
]
It seems as if the code is executing properly but the response body indicates that the email is queued. I decided to wait 24 hours and nothing has changed. I sent some more test emails and I get the same result. Basically, the emails are not sending. What is going on?
apparently for Mandrill work with Back4App you need to setup a own domain, and it looks like you're using a Gmail email address. Therefore, it is recommended to use SendGrid in this case :)

Square-Connect GET refunds ignoring time filter

I'm using the Square Connect API to retrieve refunds using the begin/end time filter, and it appears that the begin_time filter is being ignored.
Here is the request:
https://connect.squareup.com/v1/me/refunds?begin_time=2014-04-26T00%3A33%3A54Z&end_time=2014-05-26T00%3A33%3A54Z
Here's the response
[
{
"type": "FULL",
"created_at": "2014-05-21T18:27:59-04:00",
"processed_at": "2014-05-21T18:28:00-04:00",
"reason": "Accidental charge",
"refunded_money": {
"currency_code": "USD",
"amount": -103
},
"payment_id": "qNEwqwYPHCfKAIjFtox5S"
},
{
"type": "FULL",
"created_at": "2014-05-24T01:00:53-04:00",
"processed_at": "2014-05-25T19:16:04-04:00",
"reason": "Accidental charge",
"refunded_money": {
"currency_code": "USD",
"amount": -123
},
"payment_id": "MkJHTnEKHS7larVWAP15S"
}
]
Based on my begin_time of 2014-04-26, I would not expect the results to contain either of the 2 refunds that were returned.
Am I doing something wrong, or is this a bug?
The begin_time and end_time parameters of the List Refunds endpoint specify the bounds of a time range. The endpoint returns all refunds that were created within that time range.
In the above example, the time range begins April 26 2014 and ends May 26 2014. The returned refunds were created on May 21 and May 24, both of which fall after April 26 and before May 26. The endpoint appears to be working correctly.

Resources