TagValueItem OAPI
In Surpass, you can attach metadata (known as “tags”) to items and then use these tags to organise items when authoring content, creating tests, and viewing results. Tags are made up of “tag groups” and “tag values”.
Tags are made up of categorised containers called “tag groups” that contain individual tags called “tag values”. For example, a tag group called “difficulty” might have the following tag values: “Easy”, “Medium”, and “Hard”.
The TagValueItem OAPI resource is used to see how many items the tag value is assigned to. For information on tag values and tag groups, read TagValue OAPI and TagGroup OAPI. To learn how to add tag values to items, read ItemMetadata OAPI.
This article explains what calls can be made to the Surpass OAPI using the TagValueItem resource.
Import this API into your Postman Workspace
In This Article
Retrieving tag value usage
Send a request to the endpoint to retrieve tag value usage. The tag values are specified in the request body.
Parameters
Parameters are passed with the endpoint to influence the response. Header parameters are included in the request header. Path parameters are extensions of the endpoint, and query parameters follow ? after any path parameters.
Name |
Parameter |
Input |
Description |
---|---|---|---|
authorization |
header OPTIONAL |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
authorization |
header OPTIONAL |
Bearer {token} |
A bearer token must be passed to authorise the user’s request, where {token} is a JWT (JSON web token). |
content-type |
header MANDATORY |
application/json |
Determines data format of the request (JSON). |
content-length |
header MANDATORY |
{number} |
Determines the number of characters passed in the body of the request, where {number} is a numerical figure. This is usually automatically calculated when the request is sent. |
accept |
header OPTIONAL |
application/json |
Determines data format of the response (JSON). |
Sample request
The following request contains the minimum required request body to request tag value usage.
[
1
]
Request body schema
The request body schema contains a description of every property that can be passed with this endpoint.
array mandatory
Contains the tag values for which usage is requested. Multiple tag values can be listed separated by commas.
Sample response
If successful, the HTTP status code will be 200 and the response body will contain the usage statistics for the requested tag value(s).
{
"response": [
{
"id": 1,
"usage": 5
}
],
"serverTimeZone": "GMT Standard Time"
}
Response schema
The response schema contains a description of every property that can be returned for this endpoint.
results array
Contains the rest of the response.
id integer
The tag value’s unique identifier.
usage integer
The number of items the tag value has been assigned to.
serverTimeZone enumeration
The timezone of the server sending the response.
Error Codes
Refer to the following table for information on error codes that may be encountered when using this resource.
Code |
Description |
---|---|
400 |
Request body must contain tag value identifiers. |
401 |
The request has been sent by an unauthorised user. |
Further reading
Read the following articles to learn how to get started with the Surpass OAPI or more about similar APIs: