Using Sandbox on the Apico.net Website to Get Started With Apico API
This article is aimed at developers who are not yet familiar with APIFONICA REST API and want to build it into their applications quickly and easily.
It is possible to try and test Apifonica API in just a minute right on the apifonica.com website. All registered site users have a tool in their personal account – the sandbox where the developers can send requests and receive responses from Apifonica API and see how to acquire a phone number or enable your application to communicate before you even touch a line of code.
STEP 1 - Become a registered APIFONICA.net subscriber
If you are not yet registered to APIFONICA, click here to create your subscriber’s account. It’s quick and free!
STEP 2 - Log in to the apifonica.com website
To do this:
- At the right upper corner of the website, click LOG IN and use your subscriber’s credentials.
STEP 3 - In your account, open the sandbox
To do this:
- On your subscriber’s account page, click the DEV TOOLS tab.
The sandbox page is displayed. The right part of the page lists all APIFONICA API functions grouped by their functionality. To the left, you see the details of the currently selected function: its overview, input and output parameters. It is also possible to fill in the parameters right on the page, send requests to the APIFONICA API and view what API responses.
STEP 4 - Authorize to APIFONICA API
You need a valid access token to gain access to the API functions.
Important! The access token is valid for 24 hours.
To do this:
In the sandbox, open the POST /oauth2/auth/login function.
It is displayed by default when you first open the sandbox.
- Construct the POST /oauth2/auth/login request using the following parameters:
- Your login (email) to the personal account on the apifonica.com website as client_id.
- Your password to the personal account on the apifonica.com website as client_secret.
- Type client_credentials in the grant_type.
- Click SEND REQUEST and receive an access token in the response.
Note You can also gain access to APIFONICA API from within a registered application or by using the login/password of the phone number. For more details, refer to APIFONICA API Access Rights.
STEP 5 - Assign values to the APIFONICA environment variables
This helps you to store a set of parameter/value pairs and customize requests according to this data.
To do this:
- Below the request construction area of any function, expand the ENVIRONMENT VARIABLES tab.
- Copy the value of your current access token (access_token) from the POST /oauth2/auth/login response and paste it as the token value.
- Copy the value of your subscriber ID (id) from the POST /oauth2/auth/login response and paste it as the subscriber_id value.
- Copy the ID of your application from your personal account and paste it as the app_id value.
- Copy the ID of your phone number from your personal account and paste it as the number_id value.
- Click OK.
The specified values will now replace the corresponding variables in all your other requests to APIFONICA API from the sandbox.
STEP 6 - Make HTTP calls to APIFONICA services
Construct POST, GET, PUT and DELETE requests from the APIFONICA collection by using the parameter values saved as environment variables or by specifying parameters and values explicitly.