How do I use the Aquro Cloud API from outside the app? | Aquro Help Center

Making requests to the Aquro Cloud API may be done in many different ways depending on the platform you like to work with.

In this article we will cover how to make a request to the Auth/VerifyUser API by a node.js script.

The request is done by following steps:

  1. Collect all data needed to make the request
  2. Make a HTTP post request to the Cloud Service
  3. Parsing the response

Collecting data

As described in this article there are a few required values that have to be included in all API requests.

As the Auth/VerifyUser API does not require an authenticated user we only need to have the API_APPID parameter included in our request.

The API_APPID should be equal to the ID of your app. You may find this id in the Aquro App Manager for your app.

The API Auth/VerifyUser API have some extra required parameters (read the specification for Auth/VerifyUser here).

A node.js script to make a HTTP post request to the API could then look like this:

var request = require('request');request.post(
    'https://cloud.aquro.com/cloud/Auth/VerifyUser',
    {
      form: {
        "API_APPID" : "5622ddfa8df07c02323213255",
        "Username" : "john.doe@aquro.com",
        "Password" : "MyPassword"      }
    },
    function (error, response, body) {
        if (!error && response.statusCode == 200) {
            console.log(body)
            var ret = JSON.parse(body);
            if(ret.status == "success"){
              console.log("Logged in");
            }else{
              console.log("Could not login")
              console.log(ret.message)
            }
        }else{
          console.log("Unknown error")
        }
    }
);

Calls to other APIs are done in the same way, you simple have to change the address to the API and modify the supplied arguments.