Campaign Studio

Campaign Studio API for contact bulk edit

Create bulk contact

POST /api/contacts/bulk/new

This endpoint has the following differences from the Create batch contact endpoint:

  • Processes a request asynchronously in the background

  • Returns a Job ID (e.g. bd17df6a-c5b7-4fa6-8df4-cbae45cb89af) instead of what returns Create batch contact

  • Has the capacity to process up to 10,000 contacts instead of 200 contacts

Request

See Create batch contact endpoint.

Response

HTTP 202
If the job was successfully queued.
{
   "id": "bd17df6a-c5b7-4fa6-8df4-cbae45cb89af"
}

Edit bulk contact

PUT, PATCH /api/contacts/bulk/edit

This endpoint has the following differences from the Edit batch contact endpoint:

  • Processes a request asynchronously in the background

  • Returns a job ID, such as bd17df6a-c5b7-4fa6-8df4-cbae45cb89af

  • Has the capacity to process up to 10,000 contacts instead of 200 contacts

Request

See Edit batch contact endpoint.

Response

HTTP 202
If the job was successfully queued.
{
   "id": "bd17df6a-c5b7-4fa6-8df4-cbae45cb89af"
}

Get job status

GET /api/contacts/job/{id}

Returns the status of the given job by its ID obtained in the /api/contacts/bulk/edit endpoint.

The status can be either of the following:

  • queued

  • in_progress

  • completed

    Note

    The job ID exists only temporarily for 48 hours after the job is created or processed.

If the status is “completed” and the query parameter details=1 is supplied, contact result data are also returned. Contact result data are blindly paginated without total records information. The URL for the next page is returned in the response. Every contact item contains contact ID, status code, and errors (if any).

Request

GET /api/contacts/job/bd17df6a-c5b7-4fa6-8df4-cbae45cb89af

Response

HTTP 200
If the job is in progress.
{
   "status": "in_progress"
}

HTTP 200
If the job is completed and the query parameter details=1 is supplied.
{
   "status": "completed",
   "details": {
      "next-page": "/api/contacts/job/bd17df…f4-cbae45cb89af?details=1&page=2",
      "contacts": [
         {
            "id": 356,
            "statusCode": 200,
         },
         {
            "id": 254,
            "statusCode": 201,
         },
         {
            "id": 654,
            "statusCode": 400,
            "errors": {
               "code": 400,
               "message": "email: A valid email is required., points: This value …",
               "details": {
                   "email": [
                      "A valid email is required."
                   ],
                   "points": [
                      "This value is not valid."
                   ]
               },
               "type": null
            }
         }
      ]
   }
}

HTTP 404
If the job does not exist.

Delete job

DELETE /api/contacts/job/{id}

Deletes the given job by its ID obtained in the /api/contacts/bulk/edit endpoint.

If the status of the job ID is “queued” or “in_progress”, the processing of the job is stopped.

Request

DELETE /api/contacts/job/bd17df6a-c5b7-4fa6-8df4-cbae45cb89af

Response

HTTP 200
If the job was successfully deleted.

HTTP 404
If the job no longer exists.