TaskAttachment API
Reference materials for task assignees can be attached to tasks. For information on Tasks, read Task API.
This article explains what calls can be made to the Surpass API using the TaskAttachment resource.
Import this API into your Postman Workspace
In This Article
Authoring task attachments
The TaskAttachment API resource can be used to retrieve, attach, and delete task attachments for Authoring tasks.
To learn more about Authoring tasks, read Creating an Authoring task, Working in an Authoring task as an assignee, and Working in an Authoring task as a lead assignee.
Retrieving Authoring task raw attachment data
Send a request to the endpoint to retrieve a specific attachment in Base64 encoded format using its ID. No request body is required.
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 MANDATORY |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
accept |
header OPTIONAL |
application/json or application/xml |
Determines data format of the response, which can be either JSON or XML. |
id |
path MANDATORY |
/api/v2/ItemAuthoringTask/{id}/Attachment/{id} |
Returns information for the specified item, where {id} is the task’s unique identifier, and {id} is the attachment’s unique identifier. |
Attaching a file to an Authoring task
Send a request to the endpoint to attach a file to the specified Authoring task.
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 MANDATORY |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
content-type |
header MANDATORY |
multipart/form-data |
Contains the file being passed in the request. |
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 MANDATORY |
application/json or application/xml |
Determines data format of the response, which can be either JSON or XML. |
id |
path MANDATORY |
/api/v2/ItemAuthoringTask/{id}/Attachment |
Attaches file to specified task, where {id} is the Authoring task’s unique identifier. |
Sample response
If successful, the HTTP status code will be 200 and the response body will contain the new task attachment’s details.
{
"id": 1,
"href": "https://{your Surpass instance}.surpass.com/api/v2/ItemAuthoringTask/1/Attachment",
"errors": null,
"serverTimeZone": null
}
Deleting an Authoring task attachment
Send a request to the endpoint to delete a specific attachment. No request body is required.
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 MANDATORY |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
accept |
header OPTIONAL |
application/json or application/xml |
Determines data format of the response, which can be either JSON or XML. |
id |
path MANDATORY |
/api/v2/ItemAuthoringTask/{id}/Attachment/{id} |
Deletes specified task attachment, where {id} is the task’s unique identifier, and {id} is the attachment’s unique identifier. |
Sample response
If successful, the HTTP status code will be 200 and the response body will confirm the attachment has been deleted by returning a null id.
{
"id": null,
"href": null,
"errors": null,
"serverTimeZone": null
}
Review task attachments
The TaskAttachment API resource can be used to retrieve, attach, and delete task attachments for Review tasks.
To learn more about Review tasks, read Creating a Review task, Working in a Shared Review task as an assignee, and Working in a Shared Review task as a lead assignee for Shared Review tasks. For Individual Review tasks, read Working in an Individual Review task as an assignee and Working in an Individual Review task as a lead assignee.
Retrieving Review task raw attachment data
Send a request to the endpoint to retrieve a specific attachment in Base64 encoded format using its ID. No request body is required.
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 MANDATORY |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
accept |
header OPTIONAL |
application/json or application/xml |
Determines data format of the response, which can be either JSON or XML. |
id |
path MANDATORY |
/api/v2/ItemReviewTask/{id}/Attachment/{id} |
Returns information for the specified item, where {id} is the task’s unique identifier, and {id} is the attachment’s unique identifier. |
Attaching a file to a Review task
Send a request to the endpoint to attach a file to the specified Review task.
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 MANDATORY |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
content-type |
header MANDATORY |
multipart/form-data |
Contains the file being passed in the request. |
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 MANDATORY |
application/json or application/xml |
Determines data format of the response, which can be either JSON or XML. |
id |
path MANDATORY |
/api/v2/ItemReviewTask/{id}/Attachment |
Attaches file to specified task, where {id} is the Review task’s unique identifier. |
Deleting a Review task attachment
Send a request to the endpoint to delete a specific attachment. No request body is required.
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 MANDATORY |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
accept |
header OPTIONAL |
application/json or application/xml |
Determines data format of the response, which can be either JSON or XML. |
id |
path MANDATORY |
/api/v2/ItemReviewTask/{id}/Attachment/{id} |
Deletes specified task attachment, where {id} is the task’s unique identifier, and {id} is the attachment’s unique identifier. |
Sample response
If successful, the HTTP status code will be 200 and the response body will contain the new task attachment’s details.
{
"id": 1,
"href": "https://{your Surpass instance}.surpass.com/api/v2/StandardSettingTask/1/Attachment",
"errors": null,
"serverTimeZone": null
}
Standard Setting task attachments
The TaskAttachment API resource can be used to retrieve, attach, and delete task attachments for Standard Setting tasks.
To learn more about Standard Setting tasks, read Creating a Standard Setting task, Working in a Standard Setting task as an assignee, and Working in a Standard Setting task as a lead assignee.
Retrieving Standard Setting task raw attachment data
Send a request to the endpoint to retrieve a specific attachment in Base64 encoded format using its ID. No request body is required.
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 MANDATORY |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
accept |
header OPTIONAL |
application/json or application/xml |
Determines data format of the response, which can be either JSON or XML. |
id |
path MANDATORY |
/api/v2/StandardSettingTask/{id}/Attachment/{id} |
Returns information for the specified item, where {id} is the task’s unique identifier, and {id} is the attachment’s unique identifier. |
Sample response
If successful, the HTTP status code will be 200 and the response body will contain the new task attachment’s details.
{
"id": 1,
"href": "https://{your Surpass instance}.surpass.com/api/v2/ItemReviewTask/1/Attachment",
"errors": null,
"serverTimeZone": null
}
Attaching a file to a Standard Setting task
Send a request to the endpoint to attach a file to the specified Standard Setting task.
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 MANDATORY |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
content-type |
header MANDATORY |
multipart/form-data |
Contains the file being passed in the request. |
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 MANDATORY |
application/json or application/xml |
Determines data format of the response, which can be either JSON or XML. |
id |
path MANDATORY |
/api/v2/StandardSettingTask/{id}/Attachment |
Attaches file to specified task, where {id} is the Standard Setting task’s unique identifier. |
Sample response
If successful, the HTTP status code will be 200 and the response body will confirm the attachment has been deleted by returning a null id.
{
"id": null,
"href": null,
"errors": null,
"serverTimeZone": null
}
Deleting a Standard Setting task attachment
Send a request to the endpoint to delete a specific attachment. No request body is required.
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 MANDATORY |
Basic {credentials} |
Basic authentication details must be passed to authorise the user’s request, where {credentials} is a Base64 encoded username:password string. |
accept |
header OPTIONAL |
application/json or application/xml |
Determines data format of the response, which can be either JSON or XML. |
id |
path MANDATORY |
/api/v2/StandardSettingTask/{id}/Attachment/{id} |
Deletes specified task attachment, where {id} is the task’s unique identifier, and {id} is the attachment’s unique identifier. |
Sample response
If successful, the HTTP status code will be 200 and the response body will confirm the attachment has been deleted by returning a null id.
{
"id": null,
"href": null,
"errors": null,
"serverTimeZone": null
}
Error Codes
Refer to the following table for information on error codes that may be encountered when using this resource.
Name |
Code |
Description |
---|---|---|
InternalServer |
1 |
Internal server error. |
Unauthorized |
3 |
The request has been sent by an unauthorised user. |
IncorrectFieldFormat |
4 |
A field in the request has not been completed in the correct format. |
InaccessibleOperation |
5 |
The request has been sent by a user with invalid permissions. |
InaccessibleData |
6 |
The request has been sent by a user with invalid permissions. |
MissingBody |
7 |
There is an issue with the request body. |
InvalidReference |
11 |
The unique reference code used in the request is invalid. |
NoSubjectsAssociated |
12 |
There are no subjects associated with what is defined in the request. |
InaccessibleCandidate |
13 |
The candidate defined in the request cannot be accessed. |
InvalidInputParameters |
15 |
There is an issue with the path or query parameters. |
InvalidId |
16 |
The ID number used in the request is invalid. |
Further reading
Read the following articles to learn more about similar APIs, how to get started with the Surpass API v2, and how to get the best out of this reference documentation: