In this guide we will list the contacts created for our company via the SMO.AI platform interactions.
Prerequisites
To perform this guide you will need to get an authentication token for your company from SMOC.AI. At this time there is no direct way to get this yourself but it’s being worked on.
In this guide we will use the token
XDaNkCDLpUcY4OVWBkAwyOdn
as the value to simulate having a real token available.
All data returned in this guide is test data only.
Finally you are going to need the command line curl
, a similar GUI tool or your favorite programming language to perform the calls. In our examples we will lean on the use of curl
for our examples.
Listing the contacts
Contacts represents users who have had an interaction with your company through the SMOC.AI platform and now have a relationship with your organization. The contact
API endpoint lets you query list of potential leads or current customers.
curl -X GET "http://localhost:8080/api/company/contact?limit=1" -H "accept: */*" -H "token: XDaNkCDLpUcY4OVWBkAwyOdn"
Lets look at the data returned.
{
"data": [
{
"id": "4310",
"customerId": "47",
"isConvertedCustomer": false,
"firstName": "Peter",
"lastName": "Parker",
"email": "peter.parker@acme.com",
"referralLink": "Fleks/GYMffDa01U",
"inviterUser": null,
"phoneNumber": "",
"company": "",
"status": "CUSTOMER",
"totalEarned": -25,
"totalRewards": 85,
"userInvited": [
{
"id": 4320,
"name": "testtest",
"email": "user1@acme.com",
"createdAt": "2020-11-18T07:51:35.554+0000",
"updatedAt": "2020-11-18T07:52:51.968+0000"
},
{
"id": 4337,
"name": "EvneTest",
"email": "user2@acme.com",
"createdAt": "2020-11-18T11:19:24.038+0000",
"updatedAt": "2020-11-18T11:38:34.066+0000"
},
{
"id": 4327,
"name": "user3@acme.com",
"email": "user3@acme.com",
"createdAt": "2020-11-18T08:56:31.989+0000",
"updatedAt": "2021-08-06T12:40:11.317+0000"
}
],
"conversationsCount": 1,
"messagesCount": 10,
"firstMessageDate": "Tue Nov 17 07:22:27 CET 2020",
"lastMessageDate": "Tue Nov 17 07:22:52 CET 2020",
"createdAt": "2020-11-17T07:22:26.814+0000",
"updatedAt": "2021-08-06T12:41:40.177+0000"
}
],
"leadsCount": 0,
"customerCount": 1
}