Skip to main content
Skip table of contents

Check upload status via API

The Status API endpoint allows customers to check the status of an import operation using the referenceId provided during the upload process.

This endpoint is essential for tracking the progress and success of your data imports, enabling you to quickly identify and address any issues that may arise.

Status Endpoint

https://{TAO_ADVANCE_URL}/api/v1/upload/api/v1/status/{referenceId}

Note: The {referenceId} is a placeholder for the unique identifier you received during the upload process (see section above). Replace {referenceId} with the actual ID to check the status of your specific import operation.

Example: If your referenceId is 12345, the endpoint URL would be:

https://{TAO_ADVANCE_URL}/api/v1/upload/api/v1/status/12345

Prerequisite

To use this endpoint, customers must authenticate by providing a valid Bearer token in the Authorization header. For more information, see Importing rostering data via API | Authentication.

Authentication and status instructions (example)

To obtain the Bearer token required for authorization when using the Upload API endpoint, you can fetch it by making a request to the Auth Server.

The following curl command demonstrates how to retrieve the token:

CODE
curl --location 'https://{TAO_ADVANCE_URL}/api/v1/upload/v1/oauth2/tokens' \
     --form 'grant_type="client_credentials"' \
     --form 'client_id="{{CLIENT_ID}}"' \
     --form 'client_secret="{{CLIENT_SECRET}}"'

The response from this request should be OAuth2-compliant and must be in JSON format. The access_token field in the response contains the token that should be used in the Authorization header for the Upload API endpoint. The following example displays how the relevant part of the response might look:

CODE
{
    "access_token": "<your_access_token>",
    "token_type": "Bearer",
    "expires_in": 3600,
    ...
}

The following curl command demonstrates how to check the status of an import operation:

CODE
curl --location 'https://{TAO_ADVANCE_URL}/api/v1/upload/api/v1/status/{{referenceId}}' \
     --header 'Authorization: Bearer <your_access_token>'
  • location: Status check API endpoint URL: https://{TAO_ADVANCE_URL}/api/v1/uploadpi/v1/status/{referenceId}

  • header Authorization: Use this access_token value as the Bearer token in the Authorization header when making the status request.

Upon successfully requesting the status of a file using the Status API endpoint, the response should look similar to the following JSON structure:

CODE
{
    "result": {
        "status": "processed",
        "fileLine": 2,
        "messages": []
    }
}

Response Fields

  • status: Indicates the current state of the import. Possible values are:

    • "processed": The import has been successfully completed.

    • "pending": The import is still in progress.

    • "failed": The import has encountered errors and was not successful.

  • fileLine: The number of lines from the CSV file that have been imported or processed. This provides insight into how much of the file has been handled.

  • messages: An array that contains any error messages that occurred during the import process. If the import was successful, this array will be empty. If errors occurred, detailed messages will be provided to help diagnose and resolve issues.

Possible Errors

When using the Status API endpoint, several errors may occur. Below are the common errors you might encounter, along with their corresponding response codes and messages:

Error

Description

Response Code

Content-Type

Message

Missing or Expired Bearer Token

This error occurs when the Bearer token is missing or has expired.

401 Unauthorized

text/plain

Access Denied (Plain text, not in JSON format)

Reference ID Not Found or Invalid

This error occurs if the provided referenceId is not found or is invalid, meaning the system cannot locate the file associated with the given ID.

404 Not Found

application/json

CODE
{ "message": "Reference ID not found. File not found in pending bucket." }

General Server Error

A general error that occurs during the process of checking the status, with details provided in the response message.

500 Internal Server Error

application/json

CODE
{ "message": "<Details of the specific error>" }

Insufficient Scope

This error occurs when the provided Bearer token does not have the necessary rostering scope required to access the endpoint.

403 Forbidden

application/json

CODE
{ "message": "Insufficient scope" }
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.