Customer API Documentation

Authentication and Token Generation

Endpoint: https://portal.voip.us/api/authenticate

Method: POST

Description: Authenticates user credentials and generates an API token.

Request Parameters:

  • username (string, required): Username of the user.
  • password (string, required): Password of the user.

Response:

  • status (boolean): Indicates if the authentication was successful.
  • token (string): API token for authenticated user.
  • code (integer): HTTP status code.
Retrieve All Numbers

Endpoint: https://portal.voip.us/api/get-all-number?name={customer_name}

Method: GET

Description: Retrieves all available phone numbers associated with the authenticated user.

Authorization Header: Bearer Token (API token)

Query Parameters:

  • limit (integer, optional): Limit the number of results (default: 50).
  • offset_number (integer, optional): Offset for pagination (default: 0).

Response:

  • status (boolean): Indicates the success of the operation.
  • allNumber (array): List of phone numbers with their details.
  • code (integer): HTTP status code.
Retrieve Active Numbers

Endpoint: https://portal.voip.us/api/get-all-active-number?name={customer_name}

Method: GET

Description: Retrieves all active phone numbers associated with the authenticated user.

Authorization Header: Bearer Token (API token)

Query Parameters:

  • limit (integer, optional): Limit the number of results (default: 50).
  • offset_number (integer, optional): Offset for pagination (default: 0).

Response:

  • status (boolean): Indicates the success of the operation.
  • allNumber (array): List of active phone numbers with their details.
  • code (integer): HTTP status code.
Retrieve Inventory Numbers

Endpoint: https://portal.voip.us/api/get-inventory-number?name={customer_name}

Method: GET

Description: Retrieves inventory phone numbers associated with the authenticated user.

Authorization Header: Bearer Token (API token)

Query Parameters:

  • limit (integer, optional): Limit the number of results (default: 50).
  • offset_number (integer, optional): Offset for pagination (default: 0).

Response:

  • status (boolean): Indicates the success of the operation.
  • allNumber (array): List of inventory phone numbers with their details.
  • code (integer): HTTP status code.
Retrieve Pending Numbers

Endpoint: https://portal.voip.us/api/get-pending-number?name={customer_name}

Method: GET

Description: Retrieves pending phone numbers associated with the authenticated user.

Authorization Header: Bearer Token (API token)

Query Parameters:

  • limit (integer, optional): Limit the number of results (default: 50).
  • offset_number (integer, optional): Offset for pagination (default: 0).

Response:

  • status (boolean): Indicates the success of the operation.
  • allNumber (array): List of pending phone numbers with their details.
  • code (integer): HTTP status code.
Download All Numbers

Endpoint:https://portal.voip.us/api/download-number?name={customer_name}

Method:POST

Description:Downloads phone number data as an Excel file.

Authorization Header:Bearer Token (API token)

Request Parameters:

  • name (string, required): Name of the customer.
  • type (string, required): Type of numbers to download ("inventory" or "all").
  • selectedValues (array, optional): Selected values.
  • offset_number (integer, optional): Offset for pagination (default: 0).

Response: Downloads an Excel file containing phone number data.

Error Responses

401 Unauthorized: Returned when the user is not authenticated or the API token is invalid.

Other Errors: Additional error responses may include messages describing specific issues encountered during API requests.