Create contact

What it does

You can create a new contact.

Endpoint

POST

/byon/contacts/v1/

Request Body

Attributes

Description

contact
required (body)

A comma-separated list of contact details.

  • companyAddress (optional)
  • companyName
  • contactEmail
  • contactName
  • contactPhone
  • contactTitle (optional)
  • friendlyName (optional)

Example body for a new contact

{
  "companyAddress": "myCompanyAddress",
  "companyName": "myCompanyName",
  "contactEmail": "mail@myemail.com",
  "contactName": "myContactName",
  "contactPhone": "+49231123456789",
  "contactTitle": "myContactTitle",
  "friendlyName": "myFrienldyName"
}

 

Curl

curl -X POST "https://api.tyntec.com/byon/contacts/v1/" -H  "accept: application/json" -H  "apiKey: ds9SomeApiKeyl337" -H  "content-type: application/json" -d "{  \"companyAddress\": \"myCompanyAddress\",  \"companyName\": \"myCompanyName\",  \"contactEmail\": \"mail@myemail.com\", \"contactName\": \"myContactName\",  \"contactPhone\": \"49231123456789\",  \"contactTitle\": \"myContactTitle\",  \"friendlyName\": \"myFrienldyName\"}"

 

Responses

Code

Details

201

CreatedExample

Response body

{
  "accountId": "CPaasAccountName",
  "contactId": "26c99e4d97b44c9aa50bf7fb29801ebe",
  "friendlyName": "myFrienldyName",
  "companyName": "myCompanyName",
  "companyAddress": "myCompanyAddress",
  "contactName": "myContactName",
  "contactEmail": "mail@myemail.com",
  "contactPhone": "+49231123456789",
  "contactTitle": "myContactTitle",
  "dateCreated": 1521036849011,
  "dateUpdated": 1521036849011,
  "timestampCreated": "2018-03-14T14:14:09.011Z",
  "timestampUpdated": "2018-03-14T14:14:09.011Z"
}

400

Not valid contact providedExample

Error: Bad Request

Response body

{"message":"The number provided is not valid","code":"PhoneNumberNotValid","timestamp":1521036399010}

401

Unauthorized

403

Forbidden

404

Contact not found

500

Something went wrong :-(Example Value{  "code": "string",  "message": "string",  "timestamp": 0}