how to prevent message creation api to resend complete message - microsoft-graph-api

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)

Related

Replied Message ID - Microsoft-graph

If I reply to a message using the API: https://learn.microsoft.com/en-us/graph/api/message-reply?view=graph-rest-1.0&tabs=http
, then where do I get the response id? Response is empty.
You won't get a response (or Location) header with either Send or Reply because they are asynchronous operations on the Exchange side (generally in the Graph if you used the Prefer return=minimal header you should get back a location response header with the Id of the item but because these ops are async there is no such Id at the time its accepted).
If you use CreateReply https://learn.microsoft.com/en-us/graph/api/message-createreply?view=graph-rest-1.0&tabs=http that will give you a draft item to work with and if you use immutableId's https://learn.microsoft.com/en-us/graph/outlook-immutable-id then you always have a reference to the response.

GET https://api.storekit.itunes.apple.com/inApps/v1/history/{originalTransactionId} 404

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.

Getting SignatureDoesNotMatch error from SQS SendMessage

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.

Swagger UI showing response body {} and status 0

I am using swagger to create API docs.
My issue is that once we send a call to the API, the browser sends an OPTIONS call and it returns "OK"; after that the browser sends the actual call of API and then I am not receiving the expected output.
Instead of it, it's showing no-content in response and 0 as the response code.
Please can any one help.

Adobe Flex 3 : Fault Event doesnt return XML Feed sent from Server

I am working on a flex application which communicates with a Rails backened.
When i request for some data, It sends back xml feed.
In some cases, if given parameters are not valid, then rails return an error feed with status code = 422 as following
email is wrong
But I dont get this feed in FaultEvent of Flex, How could i read error feed?
Thanks
Are you getting the result in ResultEvent in such cases? I am not sure for what all HTTP error codes FaultEvent will get invoke(I know only it goes for 404 and 500). May be its still going to ResultEvent as a valid result!
You can use HTTPService instead of URLLoader.
Flex HTTP results will not include the actual underlying HTTP response codes. It just doesn't work. (TM)

Resources