create_source is missing, create_source does not have a valid value

FirstNameL483309
Rookie
0 Votes

Hello team When i am using this api for creating contact using account ids - https://api.cc.email/v3/partner/accounts/{encoded_id}/account_operations/sync getting Error - create_source is missing, create_source does not have a valid value

 

Body - 

 

{
  "account_operation_url""/contacts",
  "account_operation_method""POST",
  "account_operation_payload""",
  "account_operation_query_parameters": [
    {
      "query_param_key""first_name",
      "query_param_value""test"
    },
    {
      "query_param_key""last_name",
      "query_param_value""test"
    },
    {
      "query_param_key""email",
      "query_param_value""test@em.com"
    }
  ],
  "account_operation_headers": [
    {
      "header_key""Accept",
      "header_value""application/json"
    }
  ]
}
1 REPLY 1
Courtney_E
Moderator
0 Votes

Hello FirstNameL483309,

 

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.

 

When sending API requests on behalf of a managed client account, I know that we don't have many specific examples available within our documentation, as they are just modified versions of standard endpoint requests sent via the POST /partner/accounts/{encoded_account_id}/account_operations/sync endpoint.

 

Here are the JSON request body schemas for GET /contacts and POST /contacts when calling account_operations:

 

[[GET /contacts by email address request body:]]

 

{

"account_operation_url": "/contacts",

"account_operation_method": "GET",

"account_operation_query_parameters": [

{"query_param_key": "email", "query_param_value": "dlang@example.com"},

{"query_param_key": "status", "query_param_value": "all"},

{"query_param_key": "include", "query_param_value":"custom_fields,list_memberships,phone_numbers,street_addresses,taggings,notes"}

],

"account_operation_headers": [

{

"header_key": "Accept",

"header_value": "application/json"

}

]

}

 

[[POST /contacts request body:]]

 

{

"account_operation_url": "/contacts",

"account_operation_method": "POST",

 

 "account_operation_payload": "{\"email_address\": { \"address\": \"dlang@example.com\", \"permission_to_send\":\"implicit\"}, \"first_name\": \"Debora\", \"last_name\": \"Lang\", \"create_source\":\"Account\", \"list_memberships\": [\"07936f78-662a-11eb-af0a-fa163e56c9b0\"]}",

 

"account_operation_query_parameters": [],

"account_operation_headers": [

{

"header_key": "Accept",

"header_value": "application/json"

}

]

}

 

[[PUT /contacts request body:]]

 

{

"account_operation_url": "/contacts/{contact_id}",

"account_operation_method": "PUT",

"account_operation_path_parameters": [

{"path_param_key": "contact_id", "path_param_value": "1618ae62-4752-11e9-9c8a-fa163e6b01c1"}

],

 "account_operation_payload": "{\"email_address\": { \"address\": \"dlang@example.com\", \"permission_to_send\":\"implicit\"}, \"first_name\": \"Debora\", \"last_name\": \"Lang\", \"create_source\":\"Account\", \"update_source\":\"Account\", \"list_memberships\": [\"07936f78-662a-11eb-af0a-fa163e56c9b0\"]}",

"account_operation_headers": [

{

"header_key": "Accept",

"header_value": "application/json"

}

]

}

 

V3 API - Partners - Send API Requests on Behalf of Managed Client Accounts

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

 

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

You can also reach our team directly/securely via email at webservices@constantcontact.com 


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