Difference between revisions of "Offerit REST API Get Global Void Ips"
From Offerit
OfferitRob (talk | contribs) |
OfferitRob (talk | contribs) |
||
Line 4: | Line 4: | ||
== '''GET /config/get_global_void_ips''' == | == '''GET /config/get_global_void_ips''' == | ||
'''Description''' | '''Description''' | ||
− | *The api/config/get_global_void_ips action | + | *The api/config/get_global_void_ips action allows retrieval of the "Global Void Allowed IPs" list set in Config -> Security |
'''Resource URL''' | '''Resource URL''' | ||
*<nowiki>https://domain/api/config/get_global_void_ips</nowiki> | *<nowiki>https://domain/api/config/get_global_void_ips</nowiki> | ||
− | *Replace domain with the | + | *Replace domain with the Offerit domain |
'''[[Offerit_REST_API_Overview#Allowed_HTTP_Request_Methods|Request Method''']] | '''[[Offerit_REST_API_Overview#Allowed_HTTP_Request_Methods|Request Method''']] |
Latest revision as of 16:37, 22 July 2022
GET /config/get_global_void_ips
Description
- The api/config/get_global_void_ips action allows retrieval of the "Global Void Allowed IPs" list set in Config -> Security
Resource URL
- https://domain/api/config/get_global_void_ips
- Replace domain with the Offerit domain
- GET
Response Format
- JSON
- HTTP headers
Parameters
Parameters must be sent with the request body. The examples below show the parameters sent as x-www-form-urlencoded
Example Request
GET
https://domain/api/config/get_global_void_ips
- Response:
true
Example Code
PHP
<?php $curl = curl_init(); $data = array(); $url = 'https://domain/api/config/get_global_void_ips'; $headers = array( 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: offerit_admin' ); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)); curl_setopt($curl, CURLOPT_URL, $url); $resp = curl_exec($curl); //dumps an associative array representation of the json var_dump(json_decode($resp, true)); // Close request to clear up some resources curl_close($curl); ?>
Python
- This example requires pip and the request library which can be installed via pip by: 'pip install requests'
import requests import json url = 'https://domain/api/config/get_global_void_ips' payload = {} headers = { 'api-key': '44b5498dbcb481a0d00b404c0169af62', 'api-username': 'offerit_admin' } res = requests.GET(url, data=payload, headers=headers) print res.json()
node.js
- This example requires npm and the request module which can be installed via npm by: 'npm install request'
var request = require('request'); data = {} var options = { url: 'https://domain/api/config/get_global_void_ips', method: 'GET', form: data, json: true, headers: { 'api-key': '44b5498dbcb481a0d00b404c0169af62', 'api-username': 'offerit_admin' } }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } else{ console.log(body); } } request(options, callback);
Curl
curl -X GET 'https://domain/api/config/get_global_void_ips' -H "api-key: 44b5498dbcb481a0d00b404c0169af62" -H "api-username: offerit_admin" -H "Content-Type: application/x-www-form-urlencoded"