The Response Object
#
ResponseThe SkyCiv API will run all the functions you define and respond with a JSON object which contains the results in two components.
- The
response
property provides an object containing the results of the last function executed and some additional helpful information. - The
functions
property provides an array of objects where each object contains the results of the respective function.
Consider the functions we provided in the request object in the Creating the API Object section. The functions
property in the response will look as follows:
Response structure
#
Interpreting the responseThe API call will provide a response which we conventionally name res
or response
as shown in the previous section. After parsing this to a JSON object (turning the text into a structured object), we can read the data shown in the code block below.
If data.response.status
equals 0
, then all functions have been successfully executed. If the response is greater than or equal to 1
, this indicates unsuccessful execution or one or more functions.
- Node.js
- HTML/JS
- Python
- C#