API Reference Getting Started Pagination & Limits MCP connector docs ⚙️ Sign into User Dashboard

Getting Started

This guide walks you through the basic steps for authenticating and interacting with the third-party API.

For a complete working example, check out our example repository which demonstrates:

1a. Obtain Access Token

Before making any requests to the API, you must authenticate using your username and password to receive an access token and refresh token.

curl -X POST https://api.newprojectmedia.com/customer-api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "<your-username>",
    "password": "<your-password>"
  }'

# Response body
{
  "accessToken": "<new-access-token>",
  "refreshToken": "<new-refresh-token>",
  "expiresIn": 3600,
  "tokenType": "Bearer"
}

💡 Store both tokens securely. The access token will be used in all subsequent API requests.

1b. Handle Token Expiration

When an access token expires (after 1 hour), use the refresh token to request a new access token. Refresh tokens remain valid for 30 days from their issue date.

curl -X POST https://api.newprojectmedia.com/customer-api/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{
    "refreshToken": "<your-refresh-token>",
  }'

# Response body
{
    "accessToken": "<new-access-token>"
}

2. Call a protected API endpoint

Here's an example of how to fetch multiple queue items, using the access token as a Bearer token:

curl -X POST https://api.newprojectmedia.com/customer-api/entities/queues \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-access-token>" \
  -d '{
    "queryType": "getItemsQuery",
    "queryParams": {
      "page": 1,
      "pageSize": 10,
      "sortBy": {
        "field": "queueDate",
        "direction": "desc"
      },
      "filters": [
        {
          "field": "status",
          "value": "Operational",
          "operator": "eq"
        }
      ],
      "source": ["projectName", "totalMw", "status"]
    }
  }'