GET /lists/{listId}/contacts

Returns paginated JSON data about contacts inside a specific list.

URL:
/lists/{listId}/contacts

Method:
GET

URL Parameters:

  • listId=[integer] required

Data Parameters:

  • page=[integer]
  • count=[integer] number of items returned per page, defaults to 10, max 100

Success Response:
Code: 200 OK
Content: 

{
    "data": [
        {
            "id": 344747366,
            "firstname": "Gregory",
            "lastname": "Claeyssens",
            "email": "gregory@test.com"
        },
        {
            "id": 874992931,
            "firstname": "Brik",
            "lastname": "Demaeyer",
            "email": "brik@test.com"
        },
        {
            "id": 825276078,
            "firstname": "Valeri",
            "lastname": "Potchekailov",
            "email": "valeri@test.com"
        }
    ],
    "meta": {
        "pagination": {
            "total": 3,
            "count": 3,
            "per_page": 10,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

Error Response:
Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 404 NOT FOUND
Content: 

{ 
   "error":{  
      "message":"Not Found",
      "status":404
   }
}

GET /lists/{listId}/contacts/{id}

Returns JSON data about a user.

URL:
/lists/{listId}/contacts/{id}

Method:
GET

URL Parameters:

  • listId=[integer] required
  • id=[integer] required

Data Parameters:

  • none

Success Response:
Code: 200 OK
Content: 

{
    "data": {
        "id": 344747366,
        "first_name": "Gregory",
        "last_name": "Claeyssens",
        "email": "gregory@test.com",
        "status": "subscribed",
    }
}

Error Response: 

Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 404 NOT FOUND
Content: 

{ 
   "error":{  
      "message":"Not Found",
      "status":404
   }
}

POST /lists/{listId}/contacts

Create a new contact inside a list.

URL:
/lists/{listId}/contacts/

Method:
POST

URL Parameters:

  • none

Body (json):

status can be one of the following: pending, subscribed, unsubscribed, cleaned (defaults to pending).

{  
   "firstname":"Chun Kay",
   "lastname":"Tang",
   "email":"chunkay@test.com",
   "status":"pending"
}

Success Response:
Code: 200 OK
Content: 

{
    "data": {
        "id": 344561278,
        "firstname":"Chun Kay",
        "lastname":"Tang",
        "email":"chunkay@test.com",
        "status":"pending"
    }
}

Error Response: 

Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 400 BAD REQUEST
Content: 

{ 
   "error":{  
      "message":"The given data failed to pass validation.",
      "status":400
   }
}

PUT /lists/{listId}/contacts/{id}

Updates an existing contact.

URL:
/lists/{listId}/contacts/{id}

Method:
PUT

URL Parameters:

  • listId=[integer] required
  • id=[integer] required

Body (json):
status can be one of the following: pending, subscribed, unsubscribed, cleaned.

{  
   "firstname":"Chun Kay",
   "lastname":"Tang",
   "email":"chunkay@test.com",
   "status":"unsubscribed"
}

Success Response:
Code: 200 OK
Content: 

{
    "data": {
        "id": 344561278,
        "firstname":"Chun Kay",
        "lastname":"Tang",
        "email":"chunkay@test.com",
        "status":"unsubscribed"
    }
}

Error Response: 

Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 400 BAD REQUEST
Content: 

{ 
   "error":{  
      "message":"The given data failed to pass validation.",
      "status":400
   }
}

Code: 404 NOT FOUND
Content: 

{ 
   "error":{  
      "message":"Not Found",
      "status":404
   }
}

DELETE /lists/{listId}/contacts/{id}

Delete an existing contact.

URL:
/lists/{listId}/contacts/{id}

Method:
DELETE

URL Parameters:

  • listId=[integer] required
  • id=[integer] required

Data Parameters:

  • none

Success Response:
Code: 200 OK

Error Response:
Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 404 NOT FOUND
Content: 

{ 
   "error":{  
      "message":"Not Found",
      "status":404
   }
}

POST /lists/{listId}/contacts/search

Returns JSON data about a user retrieved by email address

URL:
/lists/{listId}/contacts/search

Method:
POST

URL Parameters:

  • listId=[integer] required

Body (json):

{  
   "email":"john.doe@gmail.com"
}

Success Response:
Code: 200 OK
Content: 

{
    "data": {
        "id": 344747366,
        "first_name": "John",
        "last_name": "Doe",
        "email": "john.doe@gmail.com",
        "status": "subscribed",
    }
}

Error Response: 

Code: 401 UNAUTHORIZED
Content: 

{ 
   "error":{  
      "message":"Unauthenticated.",
      "status":401
   }
}

Code: 400 BAD REQUEST
Content: 

{ 
   "error":{  
      "message":"The given data failed to pass validation.",
      "status":400
   }
}

Code: 404 NOT FOUND
Content: 

{ 
   "error":{  
      "message":"Not Found",
      "status":404
   }
}
Did this answer your question?