Using cURL in the REST Examples

Using cURL in the REST Examples

The examples in this guide use the cURL tool to send HTTP requests to access, create, and manipulate REST resources on the Phonecheck.com platform. cURL is pre-installed on many Linux and Mac systems. Windows users can download a version. When using HTTPS on Windows, ensure that your system meets the cURL requirements for SSL.

cURL is an open source tool and is supported by Phonecheck.

Sending Headers and Web Form Body in Curl Request

When running the cURL examples for the REST resources, you will need to look forward to proper syntax of sending request either through Linux or Mac Operating System. Here is an example explained on how to submit a POST request through cURL.

  • Using curl command and providing URL, you can also provide Headers after preceding -H symbol

  • As Phonecheck Rest Resource receive required parameters in Form-Data you can add parameters preceding -F symbol

  • The following example submits a request to Phoncheck and receives Device information for John Doe user.

curl -X POST \ http://clientapiv2.phonecheck.com/cloud/cloudDB/getDeviceInfo/ \ -H 'Postman-Token: 5fbe23a5-5f6a-431f-98e8-bb06f397f368' \ -H 'cache-control: no-cache' \ -H 'content-type: multipart/form-data; boundary=---WebKitFormBoundary7MA4YWxkTrZu0gW' \ -F imei=C79NJCJZG5MF \ -F apiKey=f95dfa02-84s7-46a5-8b99-2c555e87bd46 \ -F user_name= johndoe