Skip to content

Latest commit

 

History

History
87 lines (57 loc) · 1.9 KB

File metadata and controls

87 lines (57 loc) · 1.9 KB

Contact Controller

Method HTTP request
get GET /veem/v1.1/contacts/{contact_id}
list GET /veem/v1.1/contacts
getBatch GET /veem/v1.1/contacts/batch/{batch_id}
create POST /veem/v1.1/contacts
create (batch) POST /veem/v1.1/contacts/batch

get

Retrieves a single contact, based on specified a contact ID.

Return

Returns a single Contact model instance.

Usage

var sdk = new VeemSDK({ accessToken: <access_token> })

sdk.contact.get(<contact_id>)
  .then(responseBody => console.log(responseBody))
  .catch(error => console.error(error))

list

Retrieves a list of contacts.

Return

Returns a list of Contact model instances.

Usage

var sdk = new VeemSDK({ accessToken: <access_token> })

var options = {
  pageNumber: 2,
  pageSize: 50,
}

sdk.contact.list(options)
  .then(responseBody => console.log(responseBody))
  .catch(error => console.error(error))

getBatch

Retrieves a batch, based on specified a batch ID.

Return

Returns a single batch instance.

Usage

var sdk = new VeemSDK({ accessToken: <access_token> })

sdk.contact.getBatch(<batch_id>)
  .then(responseBody => console.log(responseBody))
  .catch(error => console.error(error))

create

Creates a contact, or a list of contacts.

Return

Returns the created Contact model instance if sending a single contact. Returns batch instance if sending multiple contacts.

Usage

var sdk = new VeemSDK({ accessToken: <access_token> })

sdk.contact.create(payload)
  .then(responseBody => console.log(responseBody))
  .catch(error => console.error(error))