{
"openapi": "3.0.0",
"x-rapidapi-info": {
"apiVersionId": "apiversion_6a067f9f-b205-4c0d-9b9c-3acd8fd1849b",
"apiId": "api_b54da642-3d39-4b7e-8240-620ed9d4940f"
},
"x-documentation": {
"readme": "### Try out Network APIs\n\n- Select the **API** in the left panel.\n- Select the **user context** from the drop down box at the top of the page. \n- You need **API Keys** to test APIs. \n- Default Application and API keys will be populated in the **App** section based on the selected context.\n- You can change them accordingly by selecting Application and API keys\n- Specify the parameters in the **Body**. \n- You can refer to some of the examples below.\n- You can use the Device IDs listed below for trying with Nokia provided simulators.\n- Execute and get the response !\n\n-----------\n\n### Device Identifier\n\nOne of the key inputs required for using any of the Network APIs is the Device Identifier.\n\nDevice identifier uniquely identifies a mobile device connected to a telecom network.\n\nDevice Identifer could be any of the below\n- Phone number such as +3672XXXXX\n- Network access identifier such as deviceid@XXXoperator.net\n- IP Address (IPV4 or IPV6 )\n\nNokia Network as Code provides **Network** **Simulators** for you to try out APIs without connecting to a real telecom network.\n\nYou can use the below specified device IDs for trying out APIs.\n\n**Phone number** \n\n- +99999991000\n- +99999991001\n- +99999990400\n- +99999990404\n- +99999990422\n- +99999990500\n- +99999990502\n- +99999990503\n- +99999990504\n \n```\n \"device\": {\n \"phoneNumber\": \"+99999991000\"\n }\n```\n\n**Network access identifier**\n\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-1000@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-1001@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-1002@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-1003@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-0400@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-0404@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-0422@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-0500@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-0502@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-0503@testcsp.net\n- 8D8AC610-566D-4EF0-9C22-186B2A5ED793-0504@testcsp.net\n\n```\n \"device\": {\n \"networkAccessIdentifier\": \"8D8AC610-566D-4EF0-9C22-186B2A5ED793-1000@testcsp.net\"\n }\n\n```\n\n\n-----------\n\n##### Location Retrieval\n\n \n###### Get device location\n\nThis API enables to get the last known location (latitude / longitude) of a mobile device. \n\n**maxAge** is used to specify the maximum acceptable age (in seconds) of the location data. \n\nIt indicates how recent the device's location must be for your application to trust the verification result. Without **maxAge**, you might get a location that’s minutes or even hours old, depending on network update cycles\n\nRequest\n\n```\n{\n \"device\": {\n \"phoneNumber\": \"+99999991000\"\n },\n \"maxAge\": 600\n}\n```\nResponse\n\n```\n{\n\"lastLocationTime\":\"2025-06-28T09:22:49.465092Z\",\n \"area\": {\n \"areaType\":\"CIRCLE\",\n \"center\":\n {\n \"latitude\":47.48627616952785,\n \"longitude\":19.07915612501993},\n \"radius\":1000\n }\n }\n```\n\n\n-----------\n\n\n\n##### Location Verification\n\n\n###### Verify device location\n\nVerify proximity of a device to a target area. \n\nThis enables to determine if a mobile device is within a specified geo area defined by **latitude**, **longitude** and **radius** (specified in meters). \n\n\nRequest\n```\n{\n \"device\": {\n \"phoneNumber\": \"+99999991000\"\n },\n \"area\": {\n \"areaType\": \"CIRCLE\",\n \"center\": {\n \"latitude\": 50.735851,\n \"longitude\": 7.10066\n },\n \"radius\": 50000\n },\n \"maxAge\": 120\n}\n```\nResponse\n\n```\n{\n \"verificationResult\":\"FALSE\",\n \"lastLocationTime\":\"2025-06-28T09:36:48.784417Z\"\n}\n```\n\nRequest\n\n```\n{\n \"device\": {\n \"phoneNumber\": \"+99999991000\"\n },\n \"area\": {\n \"areaType\": \"CIRCLE\",\n \"center\": {\n \"latitude\": 47.44178899529922,\n \"longitude\": 19.160422047462603\n },\n \"radius\": 50000\n },\n \"maxAge\": 120\n}\n```\n\n```\n{\n \"verificationResult\":\"TRUE\",\n \"lastLocationTime\":\"2025-06-30T03:24:35.471538Z\"\n}\n```\n\n-----------\n\n\n\n##### Geofencing\n\nSubscribe to receive real-time notifications when a device enters or exits a defined geographic area.\n\nRequest\n\n```\n{\n \"protocol\": \"HTTP\",\n \"sink\": \"https://notificationSendServer12.supertelco.com\",\n \"types\": [\n \"org.camaraproject.geofencing-subscriptions.v0.area-entered\"\n ],\n \"config\": {\n \"subscriptionDetail\": {\n \"device\": {\n \"phoneNumber\": \"+99999991000\"\n },\n \"area\": {\n \"areaType\": \"CIRCLE\",\n \"center\": {\n \"latitude\": 50.735851,\n \"longitude\": 7.10066\n },\n \"radius\": 2000\n }\n },\n \"initialEvent\": true,\n \"subscriptionMaxEvents\": 10\n }\n}\n```\nResponse\n\n```\n{\n \"protocol\":\"HTTP\",\n \"sink\":\"https://notificationsendserver12.supertelco.com/\",\n \"types\":[\"org.camaraproject.geofencing-subscriptions.v0.area-entered\"],\n \"config\":\n {\n \"subscriptionDetail\":\n {\n \"device\":\n {\n \"phoneNumber\":\"+99999991000\"\n },\n \"area\":\n {\n \"areaType\":\"CIRCLE\",\n \"center\": {\"latitude\":50.735851,\"longitude\":7.10066},\"radius\":2000}\n },\n \"subscriptionMaxEvents\":10,\n \"initialEvent\":true\n },\n \"id\":\"35e2ae75-afd1-4a36-8139-919278a5147f\",\n \"startsAt\":\"2025-06-30T01:58:49.272018Z\"\n}\n```\n\n-----------\n\n\n##### Device Status\n\n\n###### Get Connectivity Status\n\nGet the connectivity status of a mobile device \n\n- CONNECTED_SMS : The device is currently reachable via SMS but not connected to mobile data. This typically means the device is attached to the network but not using a data session.\n\n- CONNECTED_DATA : The device is connected to the mobile data and is actively using or ready to use IP-based data services.\n\n- NOT_CONNECTED : The device is currently not attached to the mobile network. It may be turned off, out of coverage.\n\nRequest\n```\n{\n \"device\": {\n \"phoneNumber\": \"+99999991000\"\n }\n}\n```\nResponse\n\n```\n{\n \"connectivityStatus\":\"CONNECTED_DATA\"\n}\n```\n\n\n###### Get Roaming Status \n\nGet the roaming status of a mobile device\n- whether the device is roaming\n- Roaming country\n \n\nRequest\n\n```\n{\n \"device\": {\n \"phoneNumber\": \"+99999991000\"\n }\n}\n```\nResponse\n\n```\n{\n \"roaming\":true,\n \"countryCode\":159\n}\n```\n\nSubscribe to get notifications when there is a change on the device status \n- Connected to Not Connected\n- Not Connected to Connected\n\n\n-----------\n\n\n##### SIM Swap\n\n###### Check SIM swap \n\nCheck if the SIM swap has happened for a given phone number within a specified time period (say past \"N\" hours )\n\nRequest\n\n```\n{\n \"phoneNumber\": \"+99999991000\",\n \"maxAge\": 240\n}\n\n```\n\nResponse\n\n```\n{\n\"swapped\":true\n}\n```\n\n\n###### Get the timestamp of the last SIM Swap event\n\nGet the timestamp of the last SIM Swap event of a given phone number\n\nRequest\n\n```\n{\n \"phoneNumber\": \"+99999991000\"\n}\n```\n\nResponse\n\n```\n{\n \"latestSimChange\":\"2025-06-28T09:31:05.107Z\"\n}\n```\n\n-----------\n\n##### Quality On Demand API\n\nQuality on demand enables applications to create a QoD session for the application's requirements like Jitter, latency, Thorughput, Priority, etc. The session can be requested for a specified duration.\n\nQoD API provides the following features\n\n- Create new QoD session\n- Get all the sessions of a specified device & application\n- Get session status of a specified session\n- Extend the duration of a specified session\n- Delete or terminate a specified session\n\n\n###### Create QoD session \n\n- Specify the QoS profile \n- Specify the Device \n- Specify the Application\n\n\nRequest\n\n```\n{\n \"qosProfile\": \"QOS_E\",\n \"device\": {\n \"phoneNumber\": \"+99999991000\",\n \"ipv4Address\": {\n \"publicAddress\": \"1.1.1.1\",\n \"privateAddress\": \"1.1.1.1\"\n }\n },\n \"applicationServer\": {\n \"ipv4Address\": \"1.1.1.1\"\n },\n \"duration\": 3600\n}\n```\nResponse\n\n```\n{\n\"qosProfile\":\"QOS_E\",\n\"device\":\n {\n \"phoneNumber\":\"+99999991000\",\n \"ipv4Address\":\n {\n \"publicAddress\":\"1.1.1.1\",\n \"privateAddress\":\"1.1.1.1\"\n }\n },\n \"applicationServer\":\n {\n \"ipv4Address\":\"1.1.1.1\"\n },\n \"sessionId\":\"f8b67e8c-aa66-4ac7-85d2-f9cdd2ac289f\",\n \"qosStatus\":\"REQUESTED\",\n \"startedAt\":\"2025-06-29T12:54:40.427811Z\",\n \"expiresAt\":\"2025-06-29T13:54:40.427811Z\",\n \"duration\":3600\n}\n```\n\n###### Get all the sessions of a specified device\n\nRequest\n```\n{\n \"device\": {\n \"phoneNumber\": \"+36371113334\"\n }\n}\n```\nResponse\n\n```\n{\n \"qosProfile\":\"QOS_E\",\n \"device\":\n {\n \"phoneNumber\":\"+99999991000\",\n \"ipv4Address\":\n {\n \"publicAddress\":\"1.1.1.1\",\n \"privateAddress\":\"1.1.1.1\"\n }\n },\n \"applicationServer\":\n {\n \"ipv4Address\":\"1.1.1.1\"\n },\n \"sessionId\":\"f8b67e8c-aa66-4ac7-85d2-f9cdd2ac289f\",\n \"qosStatus\":\"AVAILABLE\",\n \"startedAt\":\"2025-06-30T01:20:53.235856Z\",\n \"expiresAt\":\"2025-06-30T02:20:53.235856Z\",\n \"duration\":3600\n}\n```\n\n###### Get the session information\n\nSpecify session id in the **Params** section.\n\n```\nsessionId = f8b67e8c-aa66-4ac7-85d2-f9cdd2ac289f\n```\n\nResponse\n\n```\n{\n \"qosProfile\":\"QOS_E\",\n \"device\":\n {\n \"phoneNumber\":\"+99999991000\",\n \"ipv4Address\":\n {\n \"publicAddress\":\"1.1.1.1\",\n \"privateAddress\":\"1.1.1.1\"\n }\n },\n \"applicationServer\":\n {\n \"ipv4Address\":\"1.1.1.1\"\n },\n \"sessionId\":\"f8b67e8c-aa66-4ac7-85d2-f9cdd2ac289f\",\n \"qosStatus\":\"AVAILABLE\",\n \"startedAt\":\"2025-06-29T12:54:40.427811Z\",\"expiresAt\":\"2025-06-29T13:54:40.427811Z\",\n \"duration\":3600\n}\n```\n\n\n###### Extend the duration of a QoS session \n\nSpecify session id in the **Params** section.\n\n```\nsessionid = f8b67e8c-aa66-4ac7-85d2-f9cdd2ac289f\n```\nRequest Body\n\n```\n{\n \"requestedAdditionalDuration\": 60\n}\n```\n\nResponse\n\n```\n{\n {\"qosProfile\":\"QOS_E\",\n \"device\": \n {\n \"phoneNumber\":\"+99999991000\",\n \"networkAccessIdentifier\":null,\n \"ipv4Address\":\n {\n \"publicAddress\":\"1.1.1.1\",\n \"privateAddress\":\"1.1.1.1\",\n \"publicPort\":null\n },\n \"ipv6Address\":null\n },\n \"devicePorts\":null,\n \"applicationServer\":\n {\n \"ipv4Address\":\"1.1.1.1\",\n \"ipv6Address\":null\n },\n \"applicationServerPorts\":null,\n \"webhook\":null,\n \"notificationUrl\":null,\n \"notificationAuthToken\":null,\n \"sessionId\":\"f8b67e8c-aa66-4ac7-85d2-f9cdd2ac289f\",\n \"qosStatus\":\"AVAILABLE\",\n \"statusInfo\":null,\n \"startedAt\":\"2025-06-29T12:54:40.427811Z\",\n \"expiresAt\":\"2025-06-29T13:55:40.427811Z\",\n \"duration\":3660\n}\n```\n\n###### Delete or terminate sessions when no longer required\n\n```\nsessionid = f8b67e8c-aa66-4ac7-85d2-f9cdd2ac289f\n```\n\n-----------\n\n##### Number Verify\n-\tVerify if the phone number entered by the user matches the number associated with the SIM in the currently-connected device—without requiring SMS codes or OTPs. This enables silent authentication.\n-\tGet the phone number linked to the current device or session enabling number capture without manual entry .\n\nChecks if the user's mobile phone number matches the phone number associated with the mobile device. It can receive either a hashed or a plain text phone number as input and compares it with the authenticated user's phone number associated with the access token, returning `true` or `false`.\n\nThe number verification API uses a 3-legged OAuth 2.0 flow, where a network subscriber (an device end-user) gives consent through an Network Provider interface. In this process, a mobile app initiates a phone number verification by requesting and receiving a check_url. This URL must be accessed via a mobile connection and involves several redirects before a successful response is passed from the Network Provider and Network as Code. This page describes the steps required to gain authorization and successfully execute the consent flow.\n\nWhen an enterprise is onboarded\n to Network as Code, it is provided with client credentials. Developers can obtain their organization credentials via the Dashboard.\n\n*Getting client credentials*\n\nAn organization might have different applications to consume multiple APIs. An application is identified by its \nRapidAPI key and user\n obtained after registering and setting up.\n\n*Getting your client credentials is the first step:*\n```\ncurl --request GET \\\n\t--url https://network-as-code.p-eu.rapidapi.com/oauth2/v1/auth/clientcredentials \\\n\t--header 'X-RapidAPI-Host: network-as-code.nokia.rapidapi.com' \\\n\t--header 'X-RapidAPI-Key: YOUR-API-KEY'\n````\n\nThe output should be your client ID and secret:\n```\n{\n \"client_id\": \"your-client-id\",\n \"client_secret\": \"your-client-secret\"\n}\n```\n\n*Getting the authorization and token endpoints:*\n\nThe endpoint below allows you to know the right authorization and token endpoints. The authorization and token endpoints will then used to retrieve the authorization code, and the access token to consume the Number Verification API.\n\nJust send a curl request to the following authorization server to get the right endpoints:\n```\ncurl --request GET \\\n\t--url https://network-as-code.p-eu.rapidapi.com/.well-known/openid-configuration \\\n\t--header 'X-RapidAPI-Host: network-as-code.nokia.rapidapi.com' \\\n\t--header 'X-RapidAPI-Key: YOUR-API-KEY'\n```\nThe output should be the authorization and token endpoints:\n```\n{\n \"authorization_endpoint\": \"https://some-auth-server.example.com/oauth2/v1/authorize\",\n \"token_endpoint\": \"https://some-auth-server.example.com/oauth2/v1/token\"\n}\n```\n\n*Getting the authorization code:*\n\nThen, a GET request can be sent again to retrieve the authorization code, which will be used to retrieve the access token. The request must be populated with the following information:\n\n| Parameter | Type | Description | Mandatory or Optional |\n|------------------------|--------|-----------------------------------------------------------------------------------------------------------------|-----------------------|\n| authorization_endpoint | string | URL for requesting access tokens, returned by previous API call, e.g., https://some-auth-server.example.com/oauth2/v1/authorize. | Mandatory |\n| scope | string | Consent purpose and scope, what functionality is this request related to, in this case it's dpv:FraudPreventionAndDetection number-verification:verify. | Mandatory |\n| response_type | string | This must be set to code. | Mandatory |\n| client_id | string | Client ID retrieved previously. | Mandatory |\n| redirect_uri | string | Application backend GET endpoint for receiving the authorization callback, e.g., https://example.com/redirect. | Mandatory |\n| login_hint | string | The end-user phone number, e.g., \"+99999991000\", used to route the request to the right network. | Mandatory |\n| state | string | Value used to maintain state between request and callback, will be sent back verbatim in the callback. | Optional |\n\n\nUsing this information you can construct the following link, which should be URL-encoded:\n\n\n```\nGET {authorization_endpoint}?scope={scope}&state={state}&response_type=code&client_id={client_id}&redirect_uri={redirect_uri}&login_hint={login_hint}\n```\n\nThis request should be executed by the end user device and not in the backend of your application, since the requesting device is used to determine authorization for the particular device. You could, for example, handle this by presenting the user with a link or a button to click to initiate the redirect flow.\n\nWhen the request is made and the redirect flow succeeds, then a `GET` request is triggered towards the app redirect URI containing the NaC authorization code, for example: `https://example.com/redirect?code=your-code-will-appear-here`\n\n*Obtaining a single-use Access Token for Number Verification*\n\nAfter obtaining the client credentials and NaC authorization code, which were done in the previous steps, you can retrieve an access token through the token endpoint. This endpoint will need to be called to issue a new access token every time a number verification is performed for this end-user device.\n\nMake a POST request to the previously obtained token endpoint. These are the parameters that should be in the request:\n\n```\ncurl -X POST https://some-auth-server.example.com/oauth2/v1/token \\\n -d client_id=previously-obtained-client-id \\\n -d client_secret=previously-obtained-client-token \\\n -d grant_type=authorization_code \\\n -d code=previously-obtained-nac-authorization-code\n```\n\nIf your request is successful, you will receive a response containing the NaC access token and the following details:\n\n```\n{\n \"access_token\": \"this-is-your-token\",\n \"token_type\": \"Bearer\",\n \"expires_in\": 1723475356,\n}\n```\n\n**Using the Number Verification API**\n\nAfter obtaining the access token, you can use it in the Number Verification API. The access token will need to be provided to the API using an Authorization: `Bearer {access_token} `header.\n\nAs an example, you would send out a verification request like so:\n#### Endpoint\n```\ncurl -X POST https://network-as-code.p-eu.rapidapi.com/passthrough/camara/v1/number-verification/number-verification/v0/verify \\\n --header 'Content-Type: application/json' \\\n --header 'X-RapidAPI-Key: YOUR-API-KEY' \\\n --header 'X-RapidAPI-Host: network-as-code.nokia.rapidapi.com' \\\n --header 'Authorization: Bearer my-token' \\\n --data '{\"phoneNumber\": \"+99999991000\"}'\n```\n\nIf you want to retrieve the phone number of the device based on the access code, you can do so like this:\n```\ncurl -X GET https://network-as-code.p-eu.rapidapi.com/passthrough/camara/v1/number-verification/number-verification/v0/device-phone-number \\\n --header \"X-RapidAPI-Key: YOUR-API-KEY\" \\\n --header \"X-RapidAPI-Host: network-as-code.nokia.rapidapi.com\" \\\n --header \"Authorization: Bearer my-token\"\n```\n\n#### Error Responses\n400 - Bad Request - Invalid Argument
\n\n```json\n{\n \"status\": 400,\n \"code\": \"INVALID_ARGUMENT\",\n \"message\": \"Client specified an invalid argument, request body or query param\"\n}\n```\n401 - Unauthorized - Authentication failed
\n\n```json\n{\n \"status\": 401,\n \"code\": \"UNAUTHENTICATED\",\n \"message\": \"Request not authenticated due to missing, invalid, or expired credentials.\"\n}\n```\n403 - Forbidden - Insufficient permissions
\n\n```json\n{\n \"status\": 403,\n \"code\": \"PERMISSION_DENIED\",\n \"message\": \"Client does not have sufficient permissions to perform this action.\"\n}\n```\n404 - Not Found - Device ID not found
\n\n```json\n{\n \"status\": 404,\n \"code\": \"IDENTIFIER_NOT_FOUND\",\n \"message\": \"The specified device identifier was not found.\"\n}\n```\n