Contacts
GET <qbench-url>/qbench/api/v1/contact/{contactId}
Will retrieve a contact by its ID
Example request:
GET /qbench/api/v1/contact/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"address": null,
"email_address": "example@example.com",
"fax": null,
"first_name": "First",
"id": 2,
"last_name": "Last",
"mobile": null,
"phone": null,
"tags": [],
}
GET <qbench-url>/qbench/api/v1/contact?page_num={pageNum}&page_size={pageSize}
Will retrieve a paginated list of contacts. Maximum page size is 50.
Optional query string param:
customer_id - Will retrieve contacts only for a specific customer ID
first_name - Will try to match the parameter with a Contact’s first name
last_name - Will try to match the parameter with a Contact’s first name
is_doctor - Will retrieve contacts if they are specified to be a doctor (Patient Centric Portal)
Example request:
GET /qbench/api/v1/contact?page_num=1&page_size=50 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{
"total_count": 75,
"total_pages": 2,
"data": [
{
"address": null,
"email_address": "example@example.com",
"fax": null,
"first_name": "First",
"id": 2,
"last_name": "Last",
"mobile": null,
"phone": null,
"tags": [],
},
{
"address": null,
"email_address": "example@example.com",
"fax": null,
"first_name": "First",
"id": 2,
"last_name": "Last",
"mobile": null,
"phone": null,
"tags": [],
},
...
]
}
POST <qbench-url>/qbench/api/v1/contact
Will create a new contact. First name and last name are required. When creating a contact, you can also include a list of customer ids. Each customer ID must be of a customer that has already been created in QBench.
Example request:
POST /qbench/api/v1/contact HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
"first_name": "First",
"last_name": "Last",
"customer_ids": [1]
}
Example response:
{"id":4}
PUT <qbench-url>/qbench/api/v1/contact/{contactId}
Will update an existing contact. Contact name cannot be null. When updating a contact, you can also include a list of customer ids. Each customer ID must be of a customer that has already been created in QBench. The list of customer IDs provided will overwrite any previous customers that were associated with the contact.
Example request:
PUT /qbench/api/v1/customer/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Content-Type: application/json
{
"phone":"(000) 000-0000",
"customer_ids": [1,2]
}
Example response:
{"message":"OK"}
DELETE <qbench-url>/qbench/api/v1/contact/{contactId}
Will delete a contact.
Example request:
DELETE /qbench/api/v1/contact/1 HTTP/1.1
Authorization: Bearer 63ff42c5-49e6-42e2-bc3f-04fbfc22bbcb
Host: <qbench-url>
Example response:
{"message":"OK"}
Comments
1 comment
This statement must be incorrect...?
When creating a new contact/customer"
"Each customer ID must be of a customer that has already been created in QBench."
However we've been told a new contact/customer can be created with the API and does not need to be already created in Qbench...?
I'm guessing this documentation just needs to be updated...
Please sign in to leave a comment.