How to update specific contact using SendGrid API - sendgrid

In order to support the GDPR user's right to rectification, we need to allow our users to update their personal records.
After careful review of the SendGrid API, we didn't find an API call to update specific contact details.
SendGrid API reference: https://docs.sendgrid.com/api-reference/
For example, we want to allow the user to change an email from an old one to a new email address.
So far, we use SendGrid API to look for user records.
curl -X POST https://api.sendgrid.com/v3/marketing/contacts/search/emails \
--header "Authorization: Bearer <<YOUR_API_KEY_HERE>>" \
--data "{'emails': ['jane_doe#example.com', 'john_doe#example.com', 'joann_doe#example.com']}"
We can also load contact details if the user {id} is known.
GET GET /marketing/contacts/{id}
It will be great if someone will tell us how to update specific user details.
For example:
POST GET /marketing/contacts/{id}
Thanks

Twilio SendGrid developer evangelist here.
When you add or update a contact with the API the record is keyed by the email address. This means that you can't update a contact's email address directly. Instead you should delete the old contact and add a new one.

https://docs.sendgrid.com/api-reference/contacts/add-or-update-a-contact
If the contact already exists in the system, any entries submitted via
this endpoint will update the existing contact. The contact to update
will be determined only by the email field and any fields omitted from
the request will remain as they were. A contact's ID cannot be used to
update the contact.
As the website notes, an email address is a unique identifier for a contact and a contact can be updated with only email address. Thus you can't update a contact's email address with a new one, but may update any other fields for the contact.
Here's an example query to update an existing contact detail.
curl -X PUT 'https://api.sendgrid.com/v3/marketing/contacts' \
-H 'Authorization: <<YOUR_SENDGRID_API_KEY_HERE>>' \
-d '{"contacts": [{"email":"john_doe#example.com", "state_province_region":"CO","postal_code":"80503"}]}'

Related

Instagram API to fetch email

I need to integrate Instagram API to fetch user's details like username and email and need to save these information for the user,
i read the below link:
https://developers.facebook.com/docs/instagram-basic-display-api
but this does not fetch the email id of the user,
i also read below link but it also does not provide email of the user:
https://developers.facebook.com/docs/instagram-api
If any body can reply, that will be helpful,
Thanks
That's a privacy issue to be able to fetch user's email and other information I think you would need to create an app that allows sign in or login then get any user that had signed in to your app, details for example if I sign in to your app you would need to get my email address you can do that using a simple database tool then convert that into an API by performing a post request once data has being sent to the database.

How to read outlook group emails with microsoft graph api?

Is there any way to read mails from group email id or is there any way to read emails without graph api?
And also is there any way to restrict graph api token to read only from desired email account?
You should use GET /users/{id of group email}/mailFolders/{id}/messages to read mails from group email id.
See reference here.
If you want to restrict graph api token to read only from desired email account, you should implement Get access on behalf of a user. Then you will be able to access the signed-in user's email only.
To answer your first question, the following call will get you the emails in a group mailbox.
GET https://graph.microsoft.com/v1.0/groups/{group-id}/conversations
Can you ask your second question in a new post as it is not related to the first? Make sure you provide information about what you are doing. What auth flow are you using?

Notifying a customer via email when order status changed to shipped with BigCommerce API

When you change the Order status to Shipped in BigCommerce, you can put in the Tracking ID and click on the check box that says "update the order status to Shipped, and notify the customer via email". This works perfectly when I'm logged in an typing manually.
If however, I create a shipment using the BigCommerce API with CURL, I don't see any way to cause the customer notification email to be sent. I have searched every place I can think of, and there doesn't seem to be anything in the API specifications or online help. I can update shipped quantities and Tracking ID just fine.
Is there a way to also send the Shipped notification via email to the customer when using the API?
If you can create a shipment via API, that should update the order status to shipped or partially shipped which will trigger an email depending on store settings (listed under Checkout in the control panel).

How to get email of a face book account

I have an android application which need the email address of the face book logged in candidate.
My application works as follows
the user can log in to my application using his face book account. After logged in he can select some items and clicks on OK button. When the user clicks the button ok we need to send an email to his "email address" telling that the details of the items he selected.
I am able to get the first_name and Last_name values but i also need the email address.
can any one tell me how to get the email.
You need to get Facebook extended permissions for that. Specifically you need the email extended permission.
Here's the link to the documentation where you can take a look at all Facebook's permissions you can use in its API.
When you authenticate, just make sure scope contains email like this:
https://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=email,read_stream

Advice needed- aweber form submission using curl?

Advice needed for backend form submission to aweber and get response.
Scenario
When customer signup at my form, I will
1. insert the customer details into my own database,
2. send them a welcome email from my system,
3. at the same time I want the email to be added into aweber (this should run in the background, so that customer no need to fill in details for second time)
If I use the php curl call alone, is it a good solution?
I want to submit form value to aweber, so that aweber add the new email into their system, and then response to my backend script?
I have seen many versions outside, which may include:
http://scripts.incutio.com/httpclient/
http://freshmeat.net/projects/curl_http_client/
http://snoopy.sourceforge.net/
Are they having any special benefit over the normal php curl call to pass in data?
I have done this successfully before just using just a cURL request, but I couldn't get aweber to accept the submission without sending the person a confirmation message of their own. Basically it acts as if you have "confirmed opt-in" turned on, even if you turn it off.
Also, aweber addlead.pl script doesn't return anything, so if you had something in mind for that it won't go anywhere.
Hope this helps!