Vonage Network Auth API

Network Auth API provides the customer the ability to authentication prior to making requests to certain Vonage Network APIs.

More information is available at https://developer.vonage.com/en/getting-started-network/authentication/

Download OpenAPI Specification

Client Authentication

Initiates the authentication process. It allows the client application to obtain an authorization code, which can then be exchanged for an access token.

gethttps://oidc.idp.vonage.com/oauth2/auth

Query Parameters

client_id
string

The ID of the application you are using to authenticate.

redirect_uri
string

The URI to automatically redirect back to after the authorization request completes. This value must exactly match the one entered in the Application configuration.

response_type
string

The type of response you want to receive. This should be set to code.

scope
string

The scope of the request. This should be set to a value following the format openid dpv:<purpose>#<api-scope>.

state
string

A unique identifier for the request that allows the backend to recognize which request it is when the redirect_uri callback is received.

login_hint
string

The phone number of the user you want to authenticate.

Responses

Redirect to the OIDC Provider

Header Parameters
Location
string
The URL to redirect to with a code ( containing the authentication code for the `/token` request) and a state parameter (containing the customer reference for tracking).

Server Authorization

Initiates the authorization process on server side.

posthttps://api-eu.vonage.com/oauth2/bc-authorize

Authentication

KeyDescriptionWhereExample
Authorization

Your JSON web token.
Read more about JWTs

Headers

Bearer <JWT>
The JWT must correlate to the App that is approved for the Network APIs usage.

Request Body
Content Type
application/x-www-form-urlencoded

login_hint
string
Required
example+447700900000

The phone number of the user you want to authenticate.

scope
string
Required
exampleopenid dpv:FraudPreventionAndDetection#check-sim-swap

The scope of the request. This should be set to a value following this format openid dpv:<purpose>#<api-scope>.

Example Request

POST /oauth2/bc-authorize HTTP/1.1
Host: api-eu.vonage.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 84

login_hint=+447700900000&scope=openid+dpv:FraudPreventionAndDetection#check-sim-swap

Responses
Content Type
application/json

Returns an authentication request ID.

auth_req_id
string
Required
example0dadaeb4-7c79-4d39-b4b0-5a6cc08bf537

The ID of the authentication request.

expires_in
string
Required
example120

The number of seconds until the authentication code expires.

interval
string
example2

The number of seconds until the next request should be made.

Example Response

{
   "auth_req_id": "0dadaeb4-7c79-4d39-b4b0-5a6cc08bf537",
   "expires_in": "120",
   "interval": "2"
}

Token Request

Make a request to obtain an access token, which should be included in the Authorization header for your API calls.

posthttps://api-eu.vonage.com/oauth2/token

Authentication

KeyDescriptionWhereExample
Authorization

Your JSON web token.
Read more about JWTs

Headers

Bearer <JWT>
The JWT must correlate to the App that is approved for the Network APIs usage.

Request Body
Content Type
application/x-www-form-urlencoded

One Of
grant_type
string
Required
exampleauthorization_code

The type of grant you are requesting. This should be set to authorization_code.

code
string
Required
example0dadaeb4-7c79-4d39-b4b0-5a6cc08bf537

The authentication code you received in the /auth request.

redirect_uri
string
Required
examplehttps://example.com/callback

The URL to Application's Redirect URI that was used in the /auth request.

Example Request»Client Authentication

POST /oauth2/token HTTP/1.1
Host: api-eu.vonage.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 113

grant_type=authorization_code&code=0dadaeb4-7c79-4d39-b4b0-5a6cc08bf537&redirect_uri=https://example.com/callback

Responses
Content Type
application/json

Returns an access token and a refresh token.

access_token
string
token_type
string
refresh_token
string

Example Response

{
   "access_token": "string",
   "token_type": "string",
   "refresh_token": "string"
}