Service Documentation Guide

Service Overview

Welcome to the service documentation guide! This service provides an API for creating tokens via the Request.php endpoint. Use the guide below to learn how to connect to the service and use it effectively.

Connecting to the Service

To connect to the service, use the following URL:

https://token.digitalblue.solutions/Request.php

Authentication

When making a request to create a token, you must include a specific `Bearer` token in the Authorization header of your request. The token must be set to TOKEN-REQUEST. For example:

Authorization: Bearer TOKEN-REQUEST
        

API Request to Create a Token

To create a token, make a POST request to the Request.php endpoint. Provide a JSON request body with the following format:

{
    "Request": "CreateToken",
    "Credentials": {
        "EmailAddress": "user@example.com",
        "Password": "password"
    },
    "RequestData": {
        "Account_ID": 12345
    }
}
        

Example Request with curl

Here's an example curl command to create a token:

curl -X POST https://token.digitalblue.solutions/Request.php \
  -H "Authorization: Bearer TOKEN-REQUEST" \
  -H "Content-Type: application/json" \
  -d '{
        "Request": "CreateToken",
        "Credentials": {
            "EmailAddress": "user@example.com",
            "Password": "password"
        },
        "RequestData": {
            "Account_ID": 12345
        }
    }'
        

The server will respond with a JSON object containing the outcome of the token creation process, including the token and any messages.

Error Handling and Troubleshooting Guide

When using the service, you may encounter various errors that can hinder the successful completion of your request. Below are explanations for each potential error, reasons why they may occur, and how to resolve them:


1. 401 Unauthorized: Authorization header missing or invalid
    - Reason for Error: This error occurs when the `Authorization` header is missing from the request, empty, or does not begin with the expected `Bearer ` prefix.
    - How to Resolve:
        - Verify that your request includes an `Authorization` header in the format: `Authorization: Bearer TOKEN`.
        - Double-check the token after the `Bearer` prefix to ensure it is correctly formatted and valid.
        - If you are unsure about the token format, consult the service documentation for more information on obtaining and using tokens.

2. 400 Bad Request: Please make sure to set a request type
    - Reason for Error: This error occurs when the `Request` field in the JSON request body is missing, empty, or set to an invalid value.
    - How to Resolve:
        - Confirm that your request includes a `Request` field with a valid request type (e.g., `CreateToken`).
        - Double-check the spelling and casing of the request type in your request to ensure it matches the service's requirements.
        - Verify that your request body is in the correct JSON format, with proper syntax and structure.

3. 401 Unauthorized: Invalid token for creating a token
    - Reason for Error: This error occurs when the request type is `CreateToken` but the provided `Bearer` token is not set to `TOKEN-REQUEST`.
    - How to Resolve:
        - When requesting to create a token, ensure the `Bearer` token in the `Authorization` header is set to `TOKEN-REQUEST`.
        - Verify that you are using the correct `Bearer` token for this specific request type.
        - If you believe your token is correct, confirm with the service provider or documentation to ensure the token requirements have not changed.

Use the error code and message provided in the response to understand the issue and take appropriate action:

  • success: This will always be set to false for an error response.
  • error.code: This is the HTTP status code indicating the type of error (e.g., 401 for unauthorized requests, 400 for bad requests).
  • error.message: A detailed message explaining the specific error. Use this information to understand what went wrong and how to resolve it.

To resolve errors, follow the guidance provided in the error message and ensure your request meets the service's requirements. If you continue to experience issues, contact support for further assistance at support@digitalblue.solutions.

Contact Information

If you encounter any issues or have questions, please contact support at support@digitalblue.solutions.