Getting started with the Playground APIs

You are about to start using the Playground APIs.

In this guide, you will learn:

  • How to authenticate to access the APIs
  • How to call a Playground API using the Sim-Swap example

High level view of the Playground architecture

High-level view of the API architecture

Before you start

Subscribe to the API Playground by following the Subscribe to the Playground Guide.

You can use your existing Orange Developer account or create one if you don't have one yet.

Authentication

To use any CAMARA API in the Playground, you need to authenticate. While this authentication process differs from production, you'll need the same type of client credentials used in production environments.

Get your credentials

  1. Follow the Subscribe to the Playground Guide
  2. Obtain your Basic Authentication credentials, which should look like:
Basic Q2xpZW50SWQ6VGhpc0Z1bm55VG9GaW5kWW91VGhlcmUhSGVsbG8gWW91IQ==

Get your access token

To obtain your API access token, use the following curl command:

curl -X POST --location "https://api.orange.com/openidconnect/playground/v1.0/token" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Accept: application/json" \
    -H "Authorization: Basic {your client credentials}" \
    -d 'grant_type=client_credentials'

You will receive a JSON Web Token (JWT) in the response:

{
  "token_type": "Bearer",
  "access_token": "{your access token}",
  "expires_in": 3600
}

The token expires 1 hour after creation. Replace {your access token} in the following examples with your actual token value.

Making your first API call

Now you can call a CAMARA API. Let's use the Sim-Swap API as an example.

The Sim-Swap API performs real-time checks on the activation date of a SIM card on the mobile network. To use it, you need to identify the SIM card using its phoneNumber.

Test phone numbers

The Playground provides pre-configured test phone numbers you can use immediately:

  • +99012345678 - Returns swapped: false
  • +990111222333 - Returns swapped: true

Example API call

curl -X POST "https://api.orange.com/camara/playground/api/sim-swap/v1/check" \
    -H "Authorization: Bearer {your access token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "phoneNumber": "+99012345678",
        "maxAge": 240
    }'

Response:

{
    "swapped": false
}

Understanding the parameters

  • phoneNumber: The phone number to check (in E.164 format)
  • maxAge: Maximum age in hours to consider for the swap check (240 = 10 days)

Next steps

Congratulations! You've successfully made your first API call.

To explore more advanced features, see the next guide: Testing with your own dataset - Learn how to mock your own phone numbers in the playground.

Additional resources

Need help?