Task: To post a response from any endpoint through client script (real-time API call).
Prerequisites (if applicable):
o API Structure.
o Trigger Point.
o Request Body
o Request body require field.
Instructions:
Step 1: Identify the API Endpoint
o Identifying the URL of the POST API endpoint where you want to send data.
Step 2: Configure API Request Parameters
o API endpoint URL.
o Request headers (if required for authentication or specific content type).
o Request body: Construct the data you want to send in the POST request. This may be in JSON, XML, or other formats.
Step 4: Initiate the POST Request
o Initiate the POST request to the API endpoint.
Outcome:
Following these steps will enable your client script to effectively call the POST API, send data to the specified endpoint, and integrate the response into your application, enhancing its functionality and data capabilities.
Further Reading:
Sample URL : click here
let gstResponse = ZDK.HTTP.request({ url: ncValidateURL, method: "POST", content: JSON.stringify(data), headers: { 'Authorization': 'Bearer ' + accessToken, 'Content-Type': 'application/json' } });
var statusCode = gstResponse.getStatusCode();
var responseData = await gstResponse.getResponse();