Skip to content

User Tags

Users that participate in table discussions don't require a login or registration. This is handled by client applications. A unique tag for each user is still required, this resource provides those tags. A user tag is required for most api interactions.

The user tag object

AttributeTypeDescription
iduuidThe unique identifier for the object.
client_iduuidThe unique identifier for the client app where the user is making Shapecasts.
tagstringThe user tag — an opaque, API-minted UUID string. You don't choose it, it's generated when the tag is created.

Example:

json
{
  "id": "d544b357-1dd7-4e42-a981-bc6754744454",
  "client_id": "a9f201c2-36eb-41e1-b30a-7bd180f02e91",
  "tag": "e7b3a91c-52f8-4d16-9c04-2a7f6b1e8d35"
}

Creating a user tag

POST https://api.cxipgroup.com/user_tags
Admin token required

To create a user tag, send an authenticated request to the above endpoint. POST /user_tags/new is also accepted as an alias. The tag takes no attributes — it is attached to the client that owns the token, and the created tag comes back to you.

Request:

bash
curl -i "https://api.cxipgroup.com/user_tags" \
  -X POST \
  -H "Authorization: Bearer adtk_c1f4e2a7-9b3d-4e6a-8f21-0a5c7d9e1b34"
javascript
const response = await fetch("https://api.cxipgroup.com/user_tags", {
  method: "POST",
  headers: {
    "Authorization": "Bearer adtk_c1f4e2a7-9b3d-4e6a-8f21-0a5c7d9e1b34"
  },
});

Response:

json
{
  "id": "d544b357-1dd7-4e42-a981-bc6754744454",
  "client_id": "a9f201c2-36eb-41e1-b30a-7bd180f02e91",
  "tag": "e7b3a91c-52f8-4d16-9c04-2a7f6b1e8d35"
}

Status codes:

StatusWhen
201 CreatedThe tag was minted. The body is the new user tag.
401 UnauthorizedMissing or invalid token.
403 ForbiddenThe token is not an admin (adtk_) token.

There is no 422 for this endpoint. You send no body — the tag value is generated, not chosen — so there is nothing to validate.

Listing user tags

GET https://api.cxipgroup.com/user_tags
Admin token required

PLANNED

Listing user tags is not yet available. This section describes a planned endpoint.

To list user tags, send an authenticated request to the above endpoint with optional parameters. This endpoint is paginated — the response is a bare array, with pagination metadata in the response headers.

Parameters:

ParameterValueDescription
limitinteger (optional)The number of records to return per page. Defaults to 20, with a maximum of 100.
pageinteger (optional)The page of records you want returned. 0 or 1 returns the first page, and any value beyond the total number of pages returns nothing.

Request:

bash
curl -i -G "https://api.cxipgroup.com/user_tags" \
  -H "Authorization: Bearer adtk_62f293ea-50d0-4162-95e4-2ceb7f7516ff" \
  --data-urlencode "limit=100" \
  --data-urlencode "page=1"
javascript
const response = await fetch("https://api.cxipgroup.com/user_tags?limit=100&page=1", {
  method: "GET",
  headers: {
    "Content-type": "application/json; charset=UTF-8",
    "Authorization": "Bearer adtk_62f293ea-50d0-4162-95e4-2ceb7f7516ff"
  },
});

Response:

json
[
  {
    "id": "d544b357-1dd7-4e42-a981-bc6754744454",
    "client_id": "a9f201c2-36eb-41e1-b30a-7bd180f02e91",
    "tag": "e7b3a91c-52f8-4d16-9c04-2a7f6b1e8d35"
  },
  {
    "id": "7c1e9b02-4f83-4a6d-b015-9e3c6b7d02f1",
    "client_id": "a9f201c2-36eb-41e1-b30a-7bd180f02e91",
    "tag": "b4f8c02d-9a15-4e67-8d3b-1f6a2c9e7b04"
  }
  // ...
]

Status codes:

StatusWhen
200 OKThe body is a bare array of user tags.
401 UnauthorizedMissing or invalid token.
403 ForbiddenThe token is not an admin (adtk_) token.

Getting a user tag

GET https://api.cxipgroup.com/user_tags/:id
Admin token required

PLANNED

Fetching a single user tag is not yet available. This section describes a planned endpoint.

To retrieve a single user tag by its id, send an authenticated request to the above endpoint.

Parameters:

ParameterValueDescription
iduuid (required)The unique identifier of the user tag to retrieve.

Request:

bash
curl -i "https://api.cxipgroup.com/user_tags/d544b357-1dd7-4e42-a981-bc6754744454" \
  -H "Authorization: Bearer adtk_c1f4e2a7-9b3d-4e6a-8f21-0a5c7d9e1b34"
javascript
const response = await fetch("https://api.cxipgroup.com/user_tags/d544b357-1dd7-4e42-a981-bc6754744454", {
  method: "GET",
  headers: {
    "Content-type": "application/json; charset=UTF-8",
    "Authorization": "Bearer adtk_c1f4e2a7-9b3d-4e6a-8f21-0a5c7d9e1b34"
  },
});

Response:

json
{
  "id": "d544b357-1dd7-4e42-a981-bc6754744454",
  "client_id": "a9f201c2-36eb-41e1-b30a-7bd180f02e91",
  "tag": "e7b3a91c-52f8-4d16-9c04-2a7f6b1e8d35"
}

Status codes:

StatusWhen
200 OKThe body is the user tag.
401 UnauthorizedMissing or invalid token.
403 ForbiddenThe token is not an admin (adtk_) token.
404 Not FoundNo user tag with that id.

Shapecaster API Documentation