Error Create source is missing

SOLVED
Go to solution
Aurum
Rookie
0 Votes


Am getting error. I tried it on development API Portal. below is the payload. 
"error_message": "create_source is missing, create_source does not have a valid value" .

 

 

{
    "contacts": [
        {
         
            "email_address": {
                "address": "f***@***.com",
                "permission_to_send": "implicit"
            },
            "first_name": "Test Jonah",
            "last_name": "USA Account",
            "company_name": "Test Clinic",
            "create_source": "Account",
            "birthday_month": 7,
            "birthday_day": 2,
            "custom_fields": [
                {
                    "custom_field_id": "69fa344-743a-11ee-b1df-fa163ec87d62",
                    "value": "Doctor"
                }
            ],
            "street_addresses": [
                {
                    "kind": "home",
                    "street": "199 SW",
                    "city": "Toronto",
                    "state": "ON",
                    "postal_code": "MNO201",
                    "country": "Canada"
                }
            ],
          
            "taggings": [
                "Staff",
                "Ignore"
            ]
        }
    ]
}

 

 






1 ACCEPTED SOLUTION
John__B
Moderator

Hello Aurum,

 

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.

 

Upon reviewing your JSON request body for the POST (create) a Contact request, I found a couple of formatting issues which would result in the request being unsuccessful. I’ll note each one below.

 

The first is the “{“contacts” : [ ] }” portion around the request body. This portion can be removed from the JSON body as it is not part of the request body schema and will result in the error you encountered. 

 

The second issue is that the values in the “taggings” portion of the request should be the tag IDs rather than the tag names. I had success with your request by making the changes in the example below:

 

{

    "email_address": {

        "address": "f***@***.com",

        "permission_to_send": "implicit"

    },

    "first_name": "Test Jonah",

    "last_name": "USA Account",

    "company_name": "Test Clinic",

    "create_source": "Account",

    "birthday_month": 7,

    "birthday_day": 2,

    "custom_fields": [

        {

            "custom_field_id": "69fa344-743a-11ee-b1df-fa163ec87d62",

            "value": "Doctor"

        }

    ],

    "street_addresses": [

        {

            "kind": "home",

            "street": "199 SW",

            "city": "Toronto",

            "state": "ON",

            "postal_code": "MNO201",

            "country": "Canada"

        }

    ],

    "taggings": [

        "{tag_id}"

    ]

}

 

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

 

Regards,


John B.
API Support Specialist
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.

View solution in original post

2 REPLIES 2
John__B
Moderator

Hello Aurum,

 

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.

 

Upon reviewing your JSON request body for the POST (create) a Contact request, I found a couple of formatting issues which would result in the request being unsuccessful. I’ll note each one below.

 

The first is the “{“contacts” : [ ] }” portion around the request body. This portion can be removed from the JSON body as it is not part of the request body schema and will result in the error you encountered. 

 

The second issue is that the values in the “taggings” portion of the request should be the tag IDs rather than the tag names. I had success with your request by making the changes in the example below:

 

{

    "email_address": {

        "address": "f***@***.com",

        "permission_to_send": "implicit"

    },

    "first_name": "Test Jonah",

    "last_name": "USA Account",

    "company_name": "Test Clinic",

    "create_source": "Account",

    "birthday_month": 7,

    "birthday_day": 2,

    "custom_fields": [

        {

            "custom_field_id": "69fa344-743a-11ee-b1df-fa163ec87d62",

            "value": "Doctor"

        }

    ],

    "street_addresses": [

        {

            "kind": "home",

            "street": "199 SW",

            "city": "Toronto",

            "state": "ON",

            "postal_code": "MNO201",

            "country": "Canada"

        }

    ],

    "taggings": [

        "{tag_id}"

    ]

}

 

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

 

Regards,


John B.
API Support Specialist
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.
Aurum
Rookie
0 Votes

Thank you very much. It worked. 

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