Got a 'How do I' question? Join 'Ask a Trainer' Monday to Friday, 11am to 4pm ET for instant help and pro tips!

GET Contacts Collection api how to pass multiple email ids

user959297
Campaign Collaborator
0 Votes

Hi Team,

 

I want to check whether the email ids contact records is available or not if available then update it else create new contact and i am using  GET Contacts Collection api but its not accepting multiple email ids.

Can you suggest any option to achieve this.

please note :  in V1 api we was using like that only but with v3 its not working in same way.  

3 REPLIES 3
Courtney_E
Moderator
0 Votes

Hello user959297,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

The query parameter to narrow by email addresses when using GET Contacts Collection will only accept one address at a time, such as would be needed by a sign-up form submission. The request format will look like: “https://api.cc.email/v3/contacts?email=address@domain.com

 

GET Contacts Collection

https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts

 

In order to search for multiple addresses at once, you’d need to either run the request for each desired address, or run the request without the email address parameter and then parse the data within your program to see if the addresses exist within the response.

 

You can also bypass the GET call by using our Sign-Up Form Endpoint, which allows you to add contacts to an account without having to make a separate API call to check if the email address already exists for a contact in the user account.

 

Create or Update a Contact Using a Single Method

https://v3.developer.constantcontact.com/api_guide/contacts_create_or_update.html

 

Sign-Up Form Endpoint

https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/createOrUpdateContact

 

If you are looking to use the API in a different capacity, such as adding/updating multiple contacts at a time via syncing them from another source, our bulk contact endpoints may be a better option.

 

Import and update large numbers of contacts using bulk activity endpoints

https://v3.developer.constantcontact.com/api_guide/import_contacts.html

 

Please have a look and let us know if you have any other questions!


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
user959297
Campaign Collaborator
0 Votes
Hi Team,

The Create or Update a Contact Using a Single Method has some condition of explicit permission that i can see in link shared by you, what is that can you explain that in details and what is the impact or changes need to do to use this.
Courtney_E
Moderator
0 Votes

Hello user959297,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

The endpoint to Create or Update a Contact Using a Single Method is specifically intended for use with sign-up forms, as it does automatically set the permission of the contact being added to explicit, meaning they have given you their explicit (rather than implied) permission to send them emails. You can learn more about differences between implied and express permission here:

 

Understanding implied and express permission for CASL and GDPR
https://knowledgebase.constantcontact.com/articles/KnowledgeBase/5924-implied-and-express-permission...

 

If you feel that explicit permission isn’t right for the way that you’ll be gathering contacts through your application, you can use this flow to add/update your contacts which incorporates three contact endpoints instead, which allows you to set the desired parameters for the Create Source and Permission to Send:

 

Step 1: Check to see if the contact exists in the account using the email query parameter to search for a contact using a specific email address.

 

GET Contacts Collection
https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/getContacts

 

Step 2: If the contact comes back as non-existent, use POST to create the contact:

 

POST (create) a Contact
https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/createContact

 

Step 3: If the contact comes back as already existing in the account. You need to append the returned data with the desired list memberships and send that back with PUT to update the contact:

 

**When Updating a contact, we need to append the new information to the old information and send all of it back in the request, because when you update a contact using a PUT, all properties are updated, overwriting all existing property values. Any properties left blank or not included in the PUT will be overwritten with a null value.

 

PUT (update) a Contact
https://v3.developer.constantcontact.com/api_reference/index.html#!/Contacts/putContact

 

Please have a look and let us know if you have any other questions!


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up