I am getting following error while hitting gupshup send message API:
error | 253 | Message specified does not match with any template
If you are sending any messages from bulk you need to first approve that template by mailing the message content to enterprise-support#smsgupshup.com with your 10 digit gupshup account Id. And also note the approved content should exactly match the message which you are trying to send from API even an extra space can cause error 253
Related
I use graph api to create a message with attachment(s).
All runs fine but the server send back the complete message in response, including the attachments.
Is there a way to only get the message id in the response ?
I try with :
string webApiUrl = $"{_apiUrl}v1.0/users/{senderId}/messages?$select=id"
but I still get the whole message with 98ko of attachment.
You can do it using the prefer:return=minimal header in the request which will mean you will just get a 204 response. However the id of the item that was created will be returned in the location header (the response should really have the OData-EntityId if they are following the oData spec to the letter, also I'm not sure why it return the Outlook v2 location rather then the graph but the message Id is the same between them)
when i called the apple api: https://api.storekit-sandbox.itunes.apple.com/inApps/v1/history/{originalTransactionId} or https://api.storekit.itunes.apple.com/inApps/v1/history/{originalTransactionId} , http response 404
and when i check the apple document https://developer.apple.com/documentation/appstoreserverapi/get_transaction_history?language=objc , i found that,404 is(AccountNotFoundError | AccountNotFoundRetryableError | AppNotFoundError | AppNotFoundRetryableError | OriginalTransactionIdNotFoundError | OriginalTransactionIdNotFoundRetryableError)
but i only can see 404, not 404xxx ;
thanks for your help;
Is it possible that you have not replaced the {originalTransactionId} with the original transaction ID value provided by Apple during the purchase?
In StoreKit v1, upon a purchase, Apple will return your app a base64 encoded string of receipt data.
Your app will have to pass this string back to you backend service.
Later on, from your backend, you can invoke /verifyReceipt to get decoded transaction information. In the in_app field of the response you will be getting a series of transactions including an original transaction ID for each one.
Now you can invoke https://api.storekit-sandbox.itunes.apple.com/inApps/v1/history/{originalTransactionId} for each transaction in the in_app array in the previous response, by replacing {originalTransactionId} with each of the original transaction IDs you received in the previous call.
Regarding the 404 response you received: 404 is a standard HTTP status code meaning "NOT_FOUND". In order to get more information about the error you need to inspect the HTTP response body. There, according to the documentation, you will receive an error code indicating the exact nature of the error.
I'm unable to implement request/reply pattern using rest protocol with solace.
I'm correctly receiving a request and I can see some headers like "solace-correlation-id" and "solace-message-id".
What I'm expecting is to return an http response with the body as message reply but I always get in my application:
org.apache.camel.ExchangeTimedOutException: The OUT message was not received within: 20000 millis due reply message with correlationID: xxxxx-1549904557890-0-26 not received on destination: #P2P/QTMP/v:cfdce68771f5/c9c4ba4a-a427-438a-9b7a-1f069608d13a.
Unfortunately the solace documentation only covers pub/sub pattern for rest but not the request/reply one.
There could be a few different things going on here.
Firstly try adding the log component between the "from" and "to" endpoints and again after the "to" endpoint as this will show you the headers of the reply, for example, using the Java DSL syntax:
from("{{fromSource}}" )
.to("log:all?level=INFO&showAll=true&multiline=true")
.to("{{toDest}}" )
.to("log:all?level=INFO&showAll=true&multiline=true")
;
I suspect the correlation id is not getting passed back. In my example I have a a NodeJS service so I set the following response header:
res.setHeader('solace-correlation-id', req.get('solace-correlation-id'));
With the additional logging, you should be able to see what is going wrong.
You are most likely missing the message ID or coorelation ID in your reply message.
https://docs.solace.com/RESTMessagingPrtl/Solace-REST-Message-Encoding.htm#2.2.6.1
When the Solace message broker receives a possible reply message routed to the HTTP client, it verifies that the reply message's message ID or correlation ID match those of the request message.
Specifically,
- the reply's message ID must match the request's message ID the
- reply's correlation ID must match the request's message ID, or the
- reply's correlation ID must match the request's correlation ID.
If any of those matches occur, the Solace message broker sends the reply message as an HTTP response to the HTTP client.
HTTP requires that there be exactly one HTTP response for each HTTP request, so each matching message ID or correlation ID can be used only in a single request-reply message exchange pattern.
If the reply message does not have a matching message ID or correlation ID as above, or if the reply message's matching message ID or correlation ID has already been consumed by an earlier reply message, the reply message is discarded.
I am constructing my own REST calls for SQS SendMessage Action.
All the parameters for SendMessage are in request body. (QueueUrl, Action and MessageBody).
I have created my own signature calculation code(mostly copied from AWS SDK Java).
Now, when my MessageBody="HelloWorld" , it works fine.
That means my signature calculation and credentials are correct.
But, when I insert a space , MessageBody="Hello World", I am getting a 403 SignatureDoesNotMatch error from SQS.
I also tried "Hello%20World" as MessageBody , but that also returns a 403 error.
Also tried "Hello+World". But got same error.
I found that aws sdk converts spaces to '+' before calculating the hash of payload.
I tried MessageBody="Hello.World" and that also worked perfectly.
Is there any issue with spaces in Message Body ?
I am sending Host and x-amz-date as the only headers in my request.
The error response from SQS suggests that the hash of the payload is the only thing different in the actual and expected canonical request.
I am trying to create an iOS chat application using Twilio's Programmable Chat.
I am able to retrieve the token from Twilio by passing device token and identity, but I am getting the 401 unauthorized Access while loading the channels(if any). I have checked my Twilio credentials
TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN
TWILIO_API_KEY
TWILIO_API_SECRET
TWILIO_IPM_SERVICE_SID
and all of them are assigned properly.
This is my response which I received from Twilio.
json = ["identity": ved, "token": eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJkNTNmZGFjZDlmMWUwODA0OGZjOGE3MDU5ZTAyYTg1Zi0xNDk4NjY5Mjc1IiwiZ3JhbnRzIjp7ImlkZW50aXR5IjoidmVkIiwiaXBfbWVzc2FnaW5nIjp7InNlcnZpY2Vfc2lkIjoiSVMwNjYxMWUwNzE4M2U0NmVkOWE5ZWM1Yzg4ZGFhZmViNCIsImVuZHBvaW50X2lkIjoiQ2hhdFNlcnZpY2U6dmVkOnVuZGVmaW5lZCJ9fSwiaWF0IjoxNDk4NjY5Mjc1LCJleHAiOjE0OTg2NzI4NzUsImlzcyI6ImQ1M2ZkYWNkOWYxZTA4MDQ4ZmM4YTcwNTllMDJhODVmIiwic3ViIjoiQUMwYjI4OWViMGUwNTc2ZGU0NDNhMTkzYzdkZjk4YTg4OCJ9.LfSUM3v70Am3d3me6BQn7NC3T6mPggD9cikjf52Qvk8]
For reference, I am getting the below stackTrace in the console.
2017-06-28 22:33:18.705 twiliochat[1252:52536] TNNotificationClient[2]: 0x7000047ea000 | 06/28/22:33:18.704 | WARNING | 7 | TNNotificationClient | onTwilsockError: 0 - Poco exception while connecting: I/O error: Bad socket descriptor
2017-06-28 22:34:07.682 twiliochat[1252:52530] TNTransportConnectingState[3]: 0x7000044d8000 | 06/28/22:34:07.680 | INFO | 9 | TNTransportConnectingState | Leaving state: Transport connecting
2017-06-28 22:34:07.682 twiliochat[1252:53398] TNTwilsockClient[4]: 0x700004143000 | 06/28/22:34:07.680 | DEBUG | 1 | TNTwilsockClient | onMessageReceived (226)
TWILSOCK V1.0 160
{"method":"close","id":"TM43a26b096fb040dca4751bef7ca17dec","payload_size":43,"payload_type":"application/json","status":{"code":401,"status":"Not authorized"}}
{"code":401,"status":"Authorization error"}
Few Notes to consider before answering this thread :
I have set up my server properly and I am doing ngrok also.
I am using node.js for server setup.
Twilio developer evangelist here.
It looks like you are using your auth token instead of your API Key when generating your access token.
Make sure you are instantiating the Access Token like this:
const accessToken = new AccessToken(
context.TWILIO_ACCOUNT_SID,
context.TWILIO_API_KEY,
context.TWILIO_API_SECRET
);
The API Key should start "SK..."
Just as a precaution, since your auth token has been exposed you should change that in your Twilio console.
Let me know if that helps at all.