Graph API allows me to get the MIME content of email calling following graph api request: GET https://graph.microsoft.com/beta/me/messages//$value .
Is there a plan to support PUT operation to allow changing of contents of email this way?
Thank you.
Related
In SOAP UI, I need to attach a multipart file in a rest api. I have stored responses for this api. I have seen this ans but could not get much help. I know that multipart files are sent in form-data. The documentation talks about some "attachment tab" but I can't find that in my case as I have stored responses - this link gives an idea about my rest api.
I have attempted to use the provided test data from the Cybersource documentation to create a token for a test PAN. However, when attempting to do so (assuming it was a REST Api) it results in a "403 - Forbidden" error. The documentation is limited, as it doesn't give much information on the API other than the following:
(Test) Endpoint: https://testsecureacceptance.cybersource.com/silent/token/create
Request to create a standalone payment token:
reference_number=123456789
transaction_type=create_payment_token
currency=usd
amount=100.00
locale=en
access_key=e2b0c0d0e0f0g0h0i0j0k0l0m0n0o0p3
profile_id=0FFEAFFB-8171-4F34-A22D-1CD38A28A384
transaction_uuid=02815b4f08e56882751a043839b7b481
signed_date_time=2013-07-11T15:16:54Z
signed_field_names=comma separated list of signed fields
unsigned_field_names=comma separated list of unsigned fields
signature=WrXOhTzhBjYMZROwiCug2My3jiZHOqATimcz5EBA07M=
payment_method=card
card_type=001
card_number=4111111111111111
card_expiry_date=12-2022
card_cvn=005
bill_to_forename=Joe
bill_to_surname=Smith
bill_to_email=joesmith#example.com
bill_to_address_line1=1 My Apartment
bill_to_address_city=Mountain View
bill_to_address_postal_code=94043
bill_to_address_state=CA
bill_to_address_country=US
Is this a REST or SOAP API? How can this be tested in Postman? I tested to check if either works, and was unsuccessful. There is no information on what to include in the header either, so this is a bit puzzling.
Example POST test I am attempting:
POST https://testsecureacceptance.cybersource.com/silent/token/create
Content-Type:application/json
Accept:application/json
{
reference_number:123456789
transaction_type:create_payment_token
currency:usd
amount:100.00
locale:en
access_key:e2b0c0d0e0f0g0h0i0j0k0l0m0n0o0p3
profile_id:0FFEAFFB-8171-4F34-A22D-1CD38A28A384
transaction_uuid:02815b4f08e56882751a043839b7b481
signed_date_time:2019-03-07T06:16:54Z
signed_field_names:profile_id,access_key,transaction_uuid,signed_field_names,unsigned_field_names,signed_date_time,locale,transaction_type,reference_number,auth_trans_ref_no,amount,currency,card_type,card_number,card_expiry_date,card_cvn,payment_method,bill_to_forename,bill_to_surname,bill_to_email,bill_to_address_line1,bill_to_address_city,bill_to_address_postal_code,bill_to_address_state,bill_to_address_country
unsigned_field_names:
signature:WrXOhTzhBjYMZROwiCug2My3jiZHOqATimcz5EBA07M=
payment_method:card
card_type:001
card_number:4111111111111111
card_expiry_date:12-2022
card_cvn:005
bill_to_forename:Joe
bill_to_surname:Smith
bill_to_email:joesmith#example.com
bill_to_address_line1:1 My Apartment
bill_to_address_city:Mountain View
bill_to_address_postal_code:94043
bill_to_address_state:CA
bill_to_address_country:US
}
"Is this a REST or SOAP API?"
The URL, https://testsecureacceptance.cybersource.com/silent/token/create, is used for Secure Acceptance Checkout API. Secure Acceptance Checkout API is neither a SOAP API or a REST API. It is designed to be used as an HTML form POST from a customers browser.
If your goal is to use a REST API from the browser then you will want to use Secure Acceptance Flexible Token documented here.
If your goal is to use Secure Acceptance Checkout API the full documentation for that is here.
"How can this be tested in Postman?"
Since this is not meant to be a REST API call but an HTML form POST and HTML response you may have limited success with Postman. For example even if you get the request to work successfully the response will be an HTML document not JSON.
One problem I see is that you are using the example signature, and that will not work for you. Ensure that you follow the documentation on how to create your signature as well as set the signed and unsigned fields.
#J.J. - the error you encountered -- "This field is invalid or missing.Please contact Customer Support.: ots_profileid' ". Is telling you that you are missing (or have an invalid) profileID in your request payload. The system doesn't know what profile to use when processing this request.
I do not have any background on Web services or Powershell.
Due to restrictions of our ETL tool not handling multipart/form-data, I need to call the REST API (Post) from PowerShell. I am using the Invoke-RestMethod cmdlet.
API is a post method doing a bulk import on the target application. It has a header for Authorization with an access token. I have figured out the headers IDictionary object.
The call has a multipart/form-data request body.
In postman, I do the following:
For key type I choose file. In key field I put "file" and in value field I place the filename with the path.
How do I replicate this request body in PowerShell?
All links I searched so far seem to be similar to my requirement but I am not able to gather/understand enough to implement.
Your help is appreciated.
I'm developing a messenger bot for facebook graph API and I want to sent batched requests with id. However, at some point, Facebook just doesn't catch them.
The documentation is not very helpful (the only thing I found: https://developers.facebook.com/docs/graph-api/making-multiple-requests)
The point is, I'm sending such a request to API (one batched request for demo purposes):
URL : https://graph.facebook.com/v2.6/
Headers:
Content-Type: application/json
Body:
access_token=XXXXXXX&batch=[{"method":"POST","headers":{"name":"Content-Type","value":"application/json; charset=UTF-8"},"relative_url":"me/messages","body":"%7B%22recipient%22%3A%7B%22id%22%3A%22YYYYY%22%7D%2C%22message%22%3A%7B%22attachment%22%3A%7B%22type%22%3A%22template%22%2C%22payload%22%3A%7B%22template_type%22%3A%22generic%22%2C%22elements%22%3A%5B%7B%22title%22%3A%22test%22%2C%22subtitle%22%3A%22test%20test%22%2C%22item_url%22%3A%22%22%2C%22image_url%22%3A%22https%3A%2F%2Fdata.fideinc.com%2Fcustom%2Fent_19286B%2Fid_1ABEA3C_image.png%22%2C%22buttons%22%3A%5B%7B%22type%22%3A%22element_share%22%7D%2C%7B%22type%22%3A%22postback%22%2C%22title%22%3A%22%5Cud83e%5Cudd11%20%5Cu0410%5Cu043a%5Cu0446%5Cu0438%5Cu0438%20%5Cu0432%20%5Cu0437%5Cu0430%5Cu0432%5Cu0435%5Cu0434%5Cu0435%5Cu043d%5Cu0438%5Cu0438%22%2C%22payload%22%3A%22offers%22%7D%5D%7D%5D%2C%22image_aspect_ratio%22%3A%22horizontal%22%7D%7D%7D%2C%22tag%22%3Anull%7D","access_token":"XXXXXXX"}]
Whatever format I used for the body element, it just responds: "{\"error\":{\"message\":\"(#100) The parameter recipient is required\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"AHiM+KytmHB\"}}"
For every body element.
Other body encodings I tried:
"{\"recipient\":{\"id\":\"YYYYY\"},\"message\":{\"attachment\":{\"type\":\"template\",\"payload\":{\"template_type\":\"generic\",\"elements\":[{\"title\":\"test\",\"subtitle\":\"test test\",\"item_url\":\"\",\"image_url\":\"https://data.fideinc.com/custom/ent_19286B/id_1ABEA3C_image.png\",\"buttons\":[{\"type\":\"element_share\"},{\"type\":\"postback\",\"title\":\"\\ud83e\\udd11 \\u0410\\u043a\\u0446\\u0438\\u0438 \\u0432 \\u0437\\u0430\\u0432\\u0435\\u0434\\u0435\\u043d\\u0438\\u0438\",\"payload\":\"offers\"}]}],\"image_aspect_ratio\":\"horizontal\"}}},\"tag\":null}"
messages=%257B%2522recipient%2522%253A%257B%2522id%2522%253A%2522YYYYY%2522%257D%252C%2522message%2522%253A%257B%2522attachment%2522%253A%257B%2522type%2522%253A%2522template%2522%252C%2522payload%2522%253A%257B%2522template_type%2522%253A%2522generic%2522%252C%2522elements%2522%253A%255B%257B%2522title%2522%253A%2522test%2522%252C%2522subtitle%2522%253A%2522test+test%2522%252C%2522item_url%2522%253A%2522%2522%252C%2522image_url%2522%253A%2522https%253A%2F%2Fdata.fideinc.com%2Fcustom%2Fent_19286B%2Fid_1ABEA3C_image.png%2522%252C%2522buttons%2522%253A%255B%257B%2522type%2522%253A%2522element_share%2522%257D%252C%257B%2522type%2522%253A%2522postback%2522%252C%2522title%2522%253A%2522%5Cud83e%5Cudd11+%5Cu0410%5Cu043a%5Cu0446%5Cu0438%5Cu0438+%5Cu0432+%5Cu0437%5Cu0430%5Cu0432%5Cu0435%5Cu0434%5Cu0435%5Cu043d%5Cu0438%5Cu0438%2522%252C%2522payload%2522%253A%2522offers%2522%257D%255D%257D%255D%252C%2522image_aspect_ratio%2522%253A%2522horizontal%2522%257D%257D%257D%252C%2522tag%2522%253Anull%257D"
And so on
P.S. I can't use any external Facebook SDK in my project, I just need to get this request right
In case someone has the same problem, the answer is incredibly simple: use http_build_query instead of json_encode...
I am trying to search gmail api with custom header (this case it is named notification-id), but it does not work. Request I am making:
GET https://www.googleapis.com/gmail/v1/users/tme/messages?includeSpamTrash=true&q=notification-id%3A560d01cef318893c3c000016
I tried the same query using default header (rfc822msgid) from google mail api and it works with this request:
GET https://www.googleapis.com/gmail/v1/users/me/messages?includeSpamTrash=true&q=rfc822msgid%3A560d01d068c_6690c6f31857290%40ip-172-31-12-127.mail
Any ideas why it does not work with custom header?
I tried to do this myself a while back, and came to the conclusion that it was not possible. Someone please correct me if I'm wrong.
According to the Advanced search-documentation, you can search for the following headers:
from, to, subject
list:
Messages with the words info#example.com in the headers, sent to or
from this list
deliveredto:
Any message with username#gmail.com in the Delivered-To: field of the
message header (which can help you find messages forwarded from
another account or ones sent to an alias).
rfc822msgid:
Locates the exact message with the specified SMTP message-id.