SparkPost email not sending - json

I"m trying to get SparkPost setup for my website but keep encountering problems. I'm sending the proper headers so I know that's the issue and am pretty sure it's something with my json body.
This is the endpoint I'm posting to: https://api.sparkpost.com/api/v1/transmissions?num_rcpt_errors=3
{
"content": {
"from":{
"name":"Testing Email",
"email":"testing#hidden.com"
},
"subject": "Thundercats are GO!!!",
"text": "Sword of Omens, give me sight BEYOND sight"
},
"recipients": [
{
"address": {
"email": "jscotto#hidden.com"
}
}
]
}
The response from the above is this:
{
"results": {
"total_rejected_recipients": 0,
"total_accepted_recipients": 1,
"id": "hidden"
}
}
I don't know what could be causing it to not send because from my knowledge, I've followed every guideline on the documentation.

Turns out the emails were sending, they're just hitting my spam box. I ended up setting up an ip_pool of sa_shared and that solved my issue.

Related

Why can't I submit a record to Zoho Sales Order API?

I'm trying to insert a record using the Zoho API, and I keep receiving a cryptic INVALID_DATA error message.
I've tried using their sample code which, of course, produces another error. And the sample code they provide for running in Postman also produces an error.
Their docs are lacking and inconsistent, and nobody is getting back to me on their message boards, and I'm getting desperate as I need to have this done today. Can anyone see what I'm doing wrong?
This is what I'm submitting via Postman
{
"data": [
{
"Owner": {
"id": "3938209039489388001"
},
"Contact_Name": {
"id": "398129039938498309"
},
"Subject": "Test",
"Product_Details": [
{
"product": {
"id": "1234567"
},
"quantity": 1
}
]
}
]
}
This is the error response
{
"data": [
{
"code": "INVALID_DATA",
"details": {
"api_name": "product",
"index": 0,
"parent_api_name": "Product_Details"
},
"message": "invalid data",
"status": "error"
}
]
}
The solution was to POST a product first, then grab that product ID and insert it under Product_Details. This is not documented, so I assumed the product would be created automatically, which it wasn't.

#Mention user in Microsoft Teams with Microsoft Graph API does not tag the user. What am I missing?

Using PowerShell's Invoke-RestMethod, I have successfully been able to make a call to "https://graph.microsoft.com/beta/teams/{team-id}/channels/{channel-id}/chatThreads" to post a message to my desired Team/Channel in a very neatly formatted way.
What I am now struggling with is #mentioning a user in the same message. I've followed the short tutorial on https://myteamsday.com/2019/03/05/sending-message-with-atmention-onto-a-channel-using-graphapi/
I get to the point where I added the mentions section to the body of the request, complete with id of the user and id of the mention.
Once I make the call, the message is posted but only the text as show in the content property. No link/mention to the actual user.
{
"rootMessage": {
"body": {
"contentType": "html",
"content": "Hello, World! <at id=\"0\">Jack Black</at>"
},
"mentions": [ {
"id": 0,
"mentionText": "Jack Black",
"mentioned": {
"id": "ac5e5x81-39Dd-4748-beTa-b5cd6t93ba67",
"displayName": "Jack Black",
"userIdentityType": "aadUser"
}
}
]
}
}
Here's one thing I noticed in the tutorial though, the guy references "https://graph.microsoft.com/beta/teams/{team-id}/channels/{channel-id}/messages" , but Microsoft Graph references "https://graph.microsoft.com/beta/teams/{team-id}/channels/{channel-id}/chatThreads"
When I replace chatThreads with message in Microsoft Graph, I get an Bad Request error message complaining about the content property cannot be null, but it is NOT null.
EDIT 1:
When using https://graph.microsoft.com/beta/teams/{team-id}/channels/{channel-id}/messages on graph explorer
{
"error": {
"code": "BadRequest",
"message": "Value cannot be null.\r\nParameter name: Content",
"innerError": {
"request-id": "f0d4fed8-7726-4338-8a68-9685a690eab5",
"date": "2019-07-02T12:46:14"
}
}
}
You need to include entities, with type 'mention', in your message and the message of the text should include <at>username</at> for each entity mentioned.

Parse Push Notifications to multiple users through REST API

I'm sending push notifications from a rails app through the parse.com REST API.
Targeting a single user works great but targeting more users with $in doesn't seem to work in my scenario.
Here's my JSON Code:
{
"where":
{
"user":
{
"__type":"Pointer",
"className":"_User",
"objectId":
{
"$in":["AAA","BBB","CCC"]
}
}
},
"data":
{ ...
Isn't it possible to use $in when targeting multiple users? I noticed that I'm also not able to to so in the parse.com push backend.
The response is:
{
"code": 106,
"error": "key objectId should be a string"
}
Anyone got an idea? I don't want to make an separate REST Call for every notification.
Okay, sorry I found the answer here: REST in Parse $in to ObjectID of Pointer Error Code 106
Or in short, this code works:
{
"where":
{
"user":
{
"$inQuery":
{
"where": {
"objectId":
{
"$in":["AAA","BBB","CCC"]
}
},
"className":"_User"
}
}
},
"data":

Error in Targeting Company Shares Using JSON

I'm trying to Target company shares (https://developers.linkedin.com/documents/targeting-company-shares) using json with LinkedIn Rest Api.
My JSON object (https://developers.linkedin.com/forum/targeting-example-using-multiple-targeting-parameters-and-json) looks like :
{
"visibility": {
"code": "anyone"
},
"comment": "Targeting Shares",
"share-target-reach": {
"share-targets": {
"share-target": [{
"code": "geos",
"tvalues": {
"tvalue": "as"
}
}, {
"code": "companySizes",
"tvalues": {
"tvalue": "201-500"
}
}]
}
}
}
But this isn't working, i'm getting the following error :
{
"errorCode": 0,
"message": "Malformed json document. Encountered unexpected array.",
"requestId": "DRWYRUVMBJ",
"status": 400,
"timestamp": 1423283491818
}
I'm not able to figure out where's the problem??
I have been playing around with this for awhile now and near as I can tell the below format will work. Basically you have to remove all the arrays, I have tried them at every level and they always cause the malformed json error. I still have no idea how to target multiple sections at once though, since the official documentation on this is very wrong. The only way I figured this part out is by doing a whole lot of guessing.
{
"visibility": {
"code": "anyone"
},
"comment": "Targeting Shares",
"share-target-reach": {
"share-targets": {
"share-target": {
"code": "geos",
"tvalues": {"tvalue": "as"}
}
}
}

REST-request yields error because Jira thinks that required field is missing

I'm trying to create a Jira-issue via REST. My request looks like this:
Method: POST
Content-Type: application/json
Body: '{"fields":{"project":"ID"}}'
The response I get looks like this
{"errorMessages":[],"errors":{"project":"project is required"}}
which is strange, since I'm providing a project in my request. Does anyone see what I'm missing here?
Seems like you are sending an incorrect JSON to JIRA, according to JIRA documentation an issue is formed like
"fields": {
"project": {
"id": "10000"
},
"summary": "something's wrong",
"issuetype": {
"id": "10000"
},
"assignee": {
"name": "homer"
}
}
but you are sending
{
"fields": {
"project": "ID"
}
}