View all methods
users.links.list
List the accounts linked to a user, optionally for a single source.
Facts
| Method | GET https://api.getdx.com/users.links.list |
| Required scope | users:read |
Arguments
Required arguments
| Name | Type | Description |
|---|---|---|
token |
Token |
Auth token passed as an HTTP header. |
user_id |
Text |
The DX user ID, as returned in id by users.list. |
Optional arguments
| Name | Type | Description |
|---|---|---|
source |
Text |
Only return accounts from this source. See Sources. |
page |
Integer |
Page number to return. Defaults to 1. |
page_size |
Integer |
Number of links to return per page. Defaults to 100, maximum 100. |
Usage info
This method requires DX Data Cloud.
Links are ordered by source, then by account ID. Each account_id can be passed to users.links.set, users.links.create, or users.links.delete. See Account IDs.
Example request
This is a typical request:
curl -sS -G "https://api.getdx.com/users.links.list" \
-H "Authorization: Bearer xxxx-xxxxxxxxx-xxxx" \
-H "Accept: application/json" \
--data-urlencode 'user_id=NTEyMDUw' \
--data-urlencode 'source=github'
Example response
This is a typical success response:
{
"ok": true,
"links": [
{
"user_id": "NTEyMDUw",
"source": "github",
"account_id": "4812"
},
{
"user_id": "NTEyMDUw",
"source": "github",
"account_id": "4813"
}
],
"next_page": null,
"total": 2,
"total_pages": 1
}
Response fields
| Field | Type | Description |
|---|---|---|
ok |
Boolean |
Indicates whether the request succeeded. |
links |
Array |
Linked accounts in the requested page. |
next_page |
Integer | null |
Next page number, or null when there are no more results. |
total |
Integer |
Total number of linked accounts. |
total_pages |
Integer |
Total number of available pages. |
Each object in links includes:
| Field | Type | Description |
|---|---|---|
user_id |
String |
DX user ID. |
source |
String |
Source the account comes from. |
account_id |
String |
Data Cloud ID of the account. |
Errors
This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok param in the response.
| Error | Description |
|---|---|
not_authed |
No authentication token provided, or Data Cloud is not enabled for the account. |
not_authorized |
The bearer token does not include users:read. |
not_found |
The user was not found. |
user_not_in_datacloud |
The user has not synced to Data Cloud yet. |
query_timeout |
Data Cloud did not respond in time. Retry the request. |
Invalid parameter: ... |
source is not supported, or page or page_size is out of range. |
Missing required parameter: user_id |
user_id was not provided. |