1. Chat
1.1. List conversations
GET /v3/chat?unread=false&excludeEmpty=false HTTP/1.1
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
$ http GET 'https://api.clinked.com/v3/chat?unread=false&excludeEmpty=false' \
'Authorization:Bearer <YOUR-TOKEN>'
$ curl 'https://api.clinked.com/v3/chat?unread=false&excludeEmpty=false' -i -X GET \
-H 'Authorization: Bearer <YOUR-TOKEN>'
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 940
[ {
"id" : "test",
"name" : "test",
"type" : "direct",
"user" : {
"id" : 2,
"name" : "Black Sheep",
"username" : "another.user",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"participants" : [ {
"id" : "uri:user:jack:1",
"user" : {
"id" : 1,
"name" : "Jack Bauer",
"username" : "jack",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"name" : "Jack Bauer",
"properties" : [ "nothumb" ]
}, {
"id" : "uri:user:another.user:2",
"user" : {
"id" : 2,
"name" : "Black Sheep",
"username" : "another.user",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"name" : "Black Sheep",
"properties" : [ "nothumb" ]
} ],
"unread" : false,
"lastMessage" : null,
"dateCreated" : 1713790760397,
"account" : 1
} ]
Path | Type | Description |
---|---|---|
|
|
Conversation ID |
|
|
Name |
|
|
Type of conversation. Either 'direct' or 'group' |
|
|
Group if type is 'group' |
|
|
Account ID |
|
|
User if type is 'direct' |
|
|
True when there are unread messages for the user |
|
|
Last message |
|
|
Account id |
|
|
Date conversation was created |
|
|
List of participants in conversation |
|
|
Participant URI |
|
|
Participant user info |
|
|
Participant full name |
|
|
Additional participant properties |
|
|
User id |
|
|
Full name |
|
|
Username |
|
|
Profile picture is defined |
|
|
Job title |
|
|
Last modified date |
|
|
User id |
|
|
Full name |
|
|
Username |
|
|
Profile picture is defined |
|
|
Job title |
|
|
Last modified date |
|
|
User / profile id |
|
|
Group name slug, used for internal identification and URIs |
|
|
Full group name, visible to a user |
1.2. Get conversation
Parameter | Description |
---|---|
|
Conversation ID |
GET /v3/chat/test HTTP/1.1
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
$ http GET 'https://api.clinked.com/v3/chat/test' \
'Authorization:Bearer <YOUR-TOKEN>'
$ curl 'https://api.clinked.com/v3/chat/test' -i -X GET \
-H 'Authorization: Bearer <YOUR-TOKEN>'
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 936
{
"id" : "test",
"name" : "test",
"type" : "direct",
"user" : {
"id" : 2,
"name" : "Black Sheep",
"username" : "another.user",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"participants" : [ {
"id" : "uri:user:jack:1",
"user" : {
"id" : 1,
"name" : "Jack Bauer",
"username" : "jack",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"name" : "Jack Bauer",
"properties" : [ "nothumb" ]
}, {
"id" : "uri:user:another.user:2",
"user" : {
"id" : 2,
"name" : "Black Sheep",
"username" : "another.user",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"name" : "Black Sheep",
"properties" : [ "nothumb" ]
} ],
"unread" : false,
"lastMessage" : null,
"dateCreated" : 1713790760377,
"account" : 1
}
Path | Type | Description |
---|---|---|
|
|
Conversation ID |
|
|
Name |
|
|
Type of conversation. Either 'direct' or 'group' |
|
|
Group if type is 'group' |
|
|
Account ID |
|
|
User if type is 'direct' |
|
|
True when there are unread messages for the user |
|
|
Last message |
|
|
Account id |
|
|
Date conversation was created |
|
|
List of participants in conversation |
|
|
Participant URI |
|
|
Participant user info |
|
|
Participant full name |
|
|
Additional participant properties |
|
|
User id |
|
|
Full name |
|
|
Username |
|
|
Profile picture is defined |
|
|
Job title |
|
|
Last modified date |
|
|
User id |
|
|
Full name |
|
|
Username |
|
|
Profile picture is defined |
|
|
Job title |
|
|
Last modified date |
|
|
User / profile id |
|
|
Group name slug, used for internal identification and URIs |
|
|
Full group name, visible to a user |
1.3. Create conversation
POST /v3/chat HTTP/1.1
Content-Type: application/json
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
Content-Length: 26
{"account": 1, "user": 2 }
$ echo '{"account": 1, "user": 2 }' | http POST 'https://api.clinked.com/v3/chat' \
'Content-Type:application/json' \
'Authorization:Bearer <YOUR-TOKEN>'
$ curl 'https://api.clinked.com/v3/chat' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YOUR-TOKEN>' \
-d '{"account": 1, "user": 2 }'
Path | Type | Description |
---|---|---|
|
|
Account id |
|
|
User id |
|
|
Group id |
HTTP/1.1 201 Created
Location: https://api.clinked.com/v3/chat/test
Content-Type: application/json;charset=UTF-8
Content-Length: 936
{
"id" : "test",
"name" : "test",
"type" : "direct",
"user" : {
"id" : 2,
"name" : "Black Sheep",
"username" : "another.user",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"participants" : [ {
"id" : "uri:user:another.user:2",
"user" : {
"id" : 2,
"name" : "Black Sheep",
"username" : "another.user",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"name" : "Black Sheep",
"properties" : [ "nothumb" ]
}, {
"id" : "uri:user:jack:1",
"user" : {
"id" : 1,
"name" : "Jack Bauer",
"username" : "jack",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"name" : "Jack Bauer",
"properties" : [ "nothumb" ]
} ],
"unread" : false,
"lastMessage" : null,
"dateCreated" : 1713790760434,
"account" : 1
}
Path | Type | Description |
---|---|---|
|
|
Conversation ID |
|
|
Name |
|
|
Type of conversation. Either 'direct' or 'group' |
|
|
Group if type is 'group' |
|
|
Account ID |
|
|
User if type is 'direct' |
|
|
True when there are unread messages for the user |
|
|
Last message |
|
|
Account id |
|
|
Date conversation was created |
|
|
List of participants in conversation |
|
|
Participant URI |
|
|
Participant user info |
|
|
Participant full name |
|
|
Additional participant properties |
|
|
User id |
|
|
Full name |
|
|
Username |
|
|
Profile picture is defined |
|
|
Job title |
|
|
Last modified date |
|
|
User id |
|
|
Full name |
|
|
Username |
|
|
Profile picture is defined |
|
|
Job title |
|
|
Last modified date |
|
|
User / profile id |
|
|
Group name slug, used for internal identification and URIs |
|
|
Full group name, visible to a user |
1.4. Update conversation
Sets conversation as read.
PATCH /v3/chat/test HTTP/1.1
Content-Type: application/json
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
Content-Length: 15
{"read": true }
$ echo '{"read": true }' | http PATCH 'https://api.clinked.com/v3/chat/test' \
'Content-Type:application/json' \
'Authorization:Bearer <YOUR-TOKEN>'
$ curl 'https://api.clinked.com/v3/chat/test' -i -X PATCH \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YOUR-TOKEN>' \
-d '{"read": true }'
Path | Type | Description |
---|---|---|
|
|
Is read |
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 936
{
"id" : "test",
"name" : "test",
"type" : "direct",
"user" : {
"id" : 2,
"name" : "Black Sheep",
"username" : "another.user",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"participants" : [ {
"id" : "uri:user:jack:1",
"user" : {
"id" : 1,
"name" : "Jack Bauer",
"username" : "jack",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"name" : "Jack Bauer",
"properties" : [ "nothumb" ]
}, {
"id" : "uri:user:another.user:2",
"user" : {
"id" : 2,
"name" : "Black Sheep",
"username" : "another.user",
"logo" : false,
"jobTitle" : "Marketing",
"lastModified" : 1514764800000
},
"name" : "Black Sheep",
"properties" : [ "nothumb" ]
} ],
"unread" : false,
"lastMessage" : null,
"dateCreated" : 1713790760317,
"account" : 1
}
Path | Type | Description |
---|---|---|
|
|
Conversation ID |
|
|
Name |
|
|
Type of conversation. Either 'direct' or 'group' |
|
|
Group if type is 'group' |
|
|
Account ID |
|
|
User if type is 'direct' |
|
|
True when there are unread messages for the user |
|
|
Last message |
|
|
Account id |
|
|
Date conversation was created |
|
|
List of participants in conversation |
|
|
Participant URI |
|
|
Participant user info |
|
|
Participant full name |
|
|
Additional participant properties |
|
|
User id |
|
|
Full name |
|
|
Username |
|
|
Profile picture is defined |
|
|
Job title |
|
|
Last modified date |
|
|
User id |
|
|
Full name |
|
|
Username |
|
|
Profile picture is defined |
|
|
Job title |
|
|
Last modified date |
|
|
User / profile id |
|
|
Group name slug, used for internal identification and URIs |
|
|
Full group name, visible to a user |
1.5. Conversation messages
1.5.1. List messages
Parameter | Description |
---|---|
|
Conversation id |
GET /v3/chat/test/messages HTTP/1.1
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
$ http GET 'https://api.clinked.com/v3/chat/test/messages' \
'Authorization:Bearer <YOUR-TOKEN>'
$ curl 'https://api.clinked.com/v3/chat/test/messages' -i -X GET \
-H 'Authorization: Bearer <YOUR-TOKEN>'
Parameter | Description |
---|---|
|
Message offset |
|
Mark conversation as read |
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 451
{
"offset" : null,
"items" : [ {
"id" : "id",
"deliveryId" : "delivery-1",
"source" : {
"id" : "uri:user:jack:1",
"name" : "Jack Bauer",
"properties" : [ "nothumb" ]
},
"body" : "message",
"type" : "text",
"read" : true,
"messageOffset" : "dummyOffset",
"dateSent" : "2024-04-22T12:59:20.479+0000",
"dateReceived" : "2024-04-22T12:59:20.479+0000"
} ],
"size" : null,
"more" : false
}
Path | Type | Description |
---|---|---|
|
|
Next offset for the messages |
|
|
Has more messages |
|
|
Array of messages |
|
|
Page size |
|
|
Message ID |
|
|
Unique delivery ID when message in transit |
|
|
Message text |
|
|
Type of message. Either 'text', 'update' or 'type' |
|
|
Message is read or unread |
|
|
Date the message was sent from client |
|
|
Date the message was received on server |
|
|
Conversation participant who sent the message |
|
|
Participant URI |
|
|
Participant full name |
|
|
Additional participant properties |
|
|
Message offset from which other messages can be paginated |
1.5.2. Create message
Parameter | Description |
---|---|
|
Conversation id |
POST /v3/chat/test/messages HTTP/1.1
Content-Type: application/json
Authorization: Bearer <YOUR-TOKEN>
Host: api.clinked.com
Content-Length: 76
{"type": "text","body": "Hello","dateSent": "2000-10-31T01:30:00.000-05:00"}
$ echo '{"type": "text","body": "Hello","dateSent": "2000-10-31T01:30:00.000-05:00"}' | http POST 'https://api.clinked.com/v3/chat/test/messages' \
'Content-Type:application/json' \
'Authorization:Bearer <YOUR-TOKEN>'
$ curl 'https://api.clinked.com/v3/chat/test/messages' -i -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YOUR-TOKEN>' \
-d '{"type": "text","body": "Hello","dateSent": "2000-10-31T01:30:00.000-05:00"}'
Path | Type | Description |
---|---|---|
|
|
Message type text|update |
|
|
Message text |
|
|
Date sent |
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 401
{
"id" : "742af97f-3011-4602-8060-540a3218a1e6",
"deliveryId" : "cc6f7cd8-3f57-4834-97af-ce8344325587",
"source" : {
"id" : "uri:user:jack:1",
"name" : "Jack Bauer",
"properties" : [ "nothumb" ]
},
"body" : "Hello",
"type" : "text",
"read" : true,
"messageOffset" : "dummy",
"dateSent" : "2000-10-31T06:30:00.000+0000",
"dateReceived" : "2024-04-22T12:59:20.545+0000"
}
Path | Type | Description |
---|---|---|
|
|
Message ID |
|
|
Unique delivery ID when message in transit |
|
|
Message text |
|
|
Type of message. Either 'text', 'update' or 'type' |
|
|
Message is read or unread |
|
|
Date the message was sent from client |
|
|
Date the message was received on server |
|
|
Conversation participant who sent the message |
|
|
Participant URI |
|
|
Participant full name |
|
|
Additional participant properties |
|
|
Message offset from which other messages can be paginated |