Difference between revisions of "Offerit REST API Remove Global Void Ip"
From Offerit
OfferitRob (talk | contribs) (Created page with "{{Offerit Manual | show_rest_api_section = true }} == '''POST /config/remove_global_void_ip''' == '''Description''' *The api/config/remove_global_void_ip action adds a valid...") |
OfferitRob (talk | contribs) (→POST /config/remove_global_void_ip) |
||
(One intermediate revision by the same user not shown) | |||
Line 4: | Line 4: | ||
== '''POST /config/remove_global_void_ip''' == | == '''POST /config/remove_global_void_ip''' == | ||
'''Description''' | '''Description''' | ||
− | *The api/config/remove_global_void_ip action | + | *The api/config/remove_global_void_ip action removes a provided ip from the Config -> Security, Global Void Allowed IPs |
'''Resource URL''' | '''Resource URL''' |
Latest revision as of 17:03, 5 August 2022
POST /config/remove_global_void_ip
Description
- The api/config/remove_global_void_ip action removes a provided ip from the Config -> Security, Global Void Allowed IPs
Resource URL
- https://domain/api/config/remove_global_void_ip
- Replace domain with the Offerit domain
- POST
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
- ip
- type: string
- required
- ipv4 or ipv6 format
Example Request
POST
https://domain/api/config/remove_global_void_ip
- Response:
{ "result": "success", "data": "Ip removed / not in list / list not set" } { "result": "error", "data": "Invalid ip" }
Example Code
PHP
<?php $curl = curl_init(); $data = array( 'ip' => '73.279.112.30', ); $url = 'https://domain/api/config/remove_global_void_ip'; $headers = array( 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: offerit_admin' ); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); 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); ?>