http_request
BETA
This module contains functions and procedures that allows making requests to external endpoints.
For manual installations of the CARTO Analytics Toolbox, after installing it for the first time, and before using any HTTP Request function you need to call the SETUP
procedure to configure the HTTP Request functions. It also optionally sets default credentials.
HTTP_REQUEST
warning
This function consumes HTTP Request quota. Each call consumes as many units of quota as the number of rows your input table or query has. Before running, we recommend checking the size of the data to be geocoded and your available quota using the GET_HTTP_REQUEST_QUOTA_INFO
function.
warning
Calls to this function are limited to a maximum number of rows in your input table or query. At this moment, the maximum number of requests per call is 10.
Description
Performs a request to an external URL and returns the results.
api_base_url
:STRING
|NULL
url of the API where the customer account is stored. If default credentials have been configured withSETUP
NULL can be passed to use them.api_access_token
:STRING
|NULL
an API Access Token that is allowed to use the HTTP Request API. If default credentials have been configured withSETUP
NULL can be passed to use them.url
:STRING
specifies the url to make the request.options
:STRING
containing a valid JSON with the options in curl syntax. It is used through a fetch request, so options should be compliant with fetch. Notice that when adding a body, the property should be stringified if it is required buy the request. Return type
STRING
Endpoint response in base64. If a Content-Type
is specified with the the value application/json
or text/plain
the response will be returned in utf-8
.
Examples
GET_HTTP_REQUEST_QUOTA_INFO
Description
Returns statistics about the HTTP Request quota. HTTP Request quota is an daily quota that defines how many HTTP requests you can compute. Each valid row or computed request counts as one HTTP Request quota unit. The single element in the result of GET_HTTP_REQUEST_QUOTA_INFO will show your HTTP Request quota for the current daily period (availableQuota), how much you’ve spent (usedQuota).
api_base_url
:STRING
|NULL
url of the API where the customer account is stored. If default credentials have been configured withSETUP
NULL can be passed to use them.api_access_token
:STRING
|NULL
an API Access Token that is allowed to use the HTTP Request API. If default credentials have been configured withSETUP
NULL can be passed to use them.
Return type
STRING
Example
Last updated