Contacts Explanation of how to manage your contacts through the Carts Guru API.
Get Contact
GET
https://api.carts.guru/contacts
This endpoint allows you to get the information for single contact.
Query Parameters
200 Carts Guru successfully retrieved. 401 Something in your request parameters is wrong.
Copy {
"data" : [{
"_id" : "Contact's id" ,
"siteId" : "Your site id" ,
"firstName" : "Contacts first name"
"lastName" : "Contacts last name" ,
"addresses" : [{
"title" : "Residence type" ,
"line1" : "" ,
"line2" : "" ,
"postcode" : "Contacts zipcode" ,
"city" : "Contacts city" ,
"country" : "Contacts Country"
}] ,
"phoneNumbers" : [{
"title" : "type" ,
"phoneNumber" : "Contacts phone number"
}] ,
"emails" : [ "Contacts email" ] ,
"communicationPreferences" : {
"sms" : "Default" ,
"call" : "Optin" ,
"email" : "Optout"
}
}]
}
Update Contact's Opt-in Status
POST
https://api.carts.guru/contacts/:id
This endpoint allows you to change the contacts Opt-in status.
Path Parameters
Query Parameters
Request Body
200 Contacts document with all updated parameters. 401 Something in your request parameters is wrong. 404 Could not find a contact matching your request.
Copy
{ "data": [{ "_id": "Contact's id", "siteId": "Your site id", "firstName": "Contacts first name" "lastName": "Contacts last name", "addresses": [{ "title": "Residence type", "line1": "", "line2": "", "postcode": "Contacts zipcode", "city": "Contacts city", "country": "Contacts Country" }], "phoneNumbers": [{ "title": "type", "phoneNumber": "Contacts phone number" }], "emails": ["Contacts email"], "communicationPreferences": { "sms": "Default", "call": "Optin", "email": "Optout" } }] }
Copy {
"statusCode" : "404" ,
"error" : 'Not Found' ,
"message" : 'Contact: x Not found'
}
Anonymize Contact
PUT
https://api.carts.guru/contacts/:id
Allows you to delete all the identifying properties of your contacts on Carts Guru database
Path Parameters
Query Parameters
200 The contacts document with all their personal information deleted. 400 The action sent is not part of the actions of the API 401 Something in your request parameters is wrong. 404 Could not find a contact matching your request.
Copy {
"data" : [{
"_id" : "Contact's id" ,
"siteId" : "Your site id" ,
"firstName" : "undefined"
"lastName" : "undefined" ,
"addresses" : "undefined" ,
"phoneNumbers" : "undefined" ,
"emails" : "undefined" ,
"communicationPreferences" : {
"sms" : "Default" ,
"call" : "Optin" ,
"email" : "Optout"
}
}]
}
Copy {
"statusCode" : "400" ,
"error" : "Bad Request" ,
"message" : "Action: jump Not found"
}
Copy {
"statusCode" : "404" ,
"error" : 'Not Found' ,
"message" : 'Contact: x Not found'
}
Copy curl -XGET https://api.carts.guru/contacts.csv?siteId= 0000000 -0000-0000-0000-0000000000 \
--header 'x-auth-key: 00000000000000000'
Import CSV File
PUT
https://api.carts.guru/contacts.csv
Allows you to import a CSV File which contains a list of all the emails/phone-numbers of your current contacts in the Carts Guru database. These contacts Opt-in status will be updated to Opt-out for the type specified in the file.
The CSV file format: 'mutipart/form-data'
File key name: 'file'
Query Parameters
200
Copy {
status : "success"
}
Copy curl -XPUT https://api.carts.guru/contacts.csv?siteId= 0000000 -0000-0000-0000-000000 \
--header 'x-auth-key: 00000000000000000' \
--form "file=@valid.csv;type=application/csv"