Home >
VTAP Platform
> Helper Method for Server Scripts and Jobs - HTTP Request
Articles in this section
Server Scripts & Jobs Overview
Using Custom Server Scripts in Processes, Workflows, and Approvals
Running Custom Background Tasks with Vtiger Server Jobs
Writing Code for Server Scripts and Jobs
Helper Method for Server Scripts and Jobs - Debugging
Helper Methods for Server Scripts and Jobs - Vtiger REST API
Server Scripts Example - Contact Email Validation and Data Enrichment
Server Scripts Example - Update Credit Score of a Contact
Server Scripts Example - Calculate Organization Outstanding Invoice Amount
Server Scripts Example - Set Case SLA by Created Day
Server Jobs Example - Importing Daily Leads from a File
Server Jobs Example - Update Stocks Weekly in Warehouse System
Server Side Scripts & Jobs User Guide
Helper Method for Server Scripts and Jobs - HTTP Request
This article describes the HTTP Request helper method for Server Scripts and Jobs.
A
Abdul Sameer
1 Jul, 2024 - Updated
4 months ago
Table of Contents
HTTP Request Methods
To send HTTP requests to external service, helper methods are available. Methods for all type of requests are provided like GET, POST, PUT, PATCH, and DELETE.
Syntax
For each request type a method is available under vtap.macro.http library. For example to send GET request, you can use vtap.macro.http.get
ExampleNote: Methods are asynchronous and return a promise, therefore it must be used with await. |
Parameters
All HTTP request methods expect 2 parameters - vtap.macro.http.
- URL - Request URL (mandatory)
- Options - JSON object containing other request options (optional)
- headers - Object containing request headers
- qs - Object containing request query string values
- body - Request body. String or JSON object if JSON is TRUE
- form - Form data object
- formData - Data to pass for a multipart/form-data request
- JSON - Boolean. Sets body to JSON representation of value and adds Content-type: application or JSON header.
- auth - Object, used for basic and bearer authentication.
Supported Methods
GET - vtap.macro.http.get
Method to send HTTP GET request
POST - vtap.macro.http.post
Method to send HTTP POST request
PUT - vtap.macro.http.put
Method to send HTTP PUT request
PATCH - vtap.macro.http.patch
Method to send HTTP PATCH request
DELETE - vtap.macro.http.delete
Method to send HTTP DELETE request
GET - vtap.macro.http.get with basic auth
Method to send HTTP GET request with basic authenticationGET - vtap.macro.http.get with bearer token
Method to send HTTP GET request with bearer authenticationConstraints
|
Was this article helpful?
0
out of
0
found this helpful.
Comments 0
Be the first to comment