Whitelist

Adding a whitelist


curl --location --request GET 'https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx'

import requests

url = "https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx"

payload={}
files={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload, files=files)

print(response.text)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx',
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => '',
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

var formdata = new FormData();

var requestOptions = {
   method: 'GET',
   body: formdata,
   redirect: 'follow'
};

fetch("https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx", requestOptions)
   .then(response => response.text())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));

package main

import (
   "fmt"
   "bytes"
   "mime/multipart"
   "net/http"
   "io/ioutil"
)

func main() {

   url := "https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx"
   method := "GET"

   payload := &bytes.Buffer{}
   writer := multipart.NewWriter(payload)
   err := writer.Close()
   if err != nil {
      fmt.Println(err)
      return
   }


   client := &http.Client {
   }
   req, err := http.NewRequest(method, url, payload)

   if err != nil {
      fmt.Println(err)
      return
   }
   req.Header.Set("Content-Type", writer.FormDataContentType())
   res, err := client.Do(req)
   if err != nil {
      fmt.Println(err)
      return
   }
   defer res.Body.Close()

   body, err := ioutil.ReadAll(res.Body)
   if err != nil {
      fmt.Println(err)
      return
   }
   fmt.Println(string(body))
}

OkHttpClient client = new OkHttpClient().newBuilder()
   .build();
MediaType mediaType = MediaType.parse("text/plain");
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, "{}");
Request request = new Request.Builder()
   .url("https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx")
   .method("GET", body)
   .build();
Response response = client.newCall(request).execute();

GET /whitelist/add

Request parameters

Name Types Required Explanation
appKey string Yes Secret key
ip string Yes
user string No If it exists, the corresponding account name will be added. If it is empty, it will be added to the main account
remark string No
                                    
https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx

                                

Corresponding results

Name Types Explanation
code int Response code
msg string Response message
                                        
{
    "code": 0,
    "msg": "success"
}

                                    
                                        
{
  "code": 1,
  "msg": "<string>"
}

                                    

curl --location --request GET 'https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx'

import requests

url = "https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx"

payload={}
files={}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload, files=files)

print(response.text)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx',
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => '',
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

var formdata = new FormData();

var requestOptions = {
   method: 'GET',
   body: formdata,
   redirect: 'follow'
};

fetch("https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx", requestOptions)
   .then(response => response.text())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));

package main

import (
   "fmt"
   "bytes"
   "mime/multipart"
   "net/http"
   "io/ioutil"
)

func main() {

   url := "https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx"
   method := "GET"

   payload := &bytes.Buffer{}
   writer := multipart.NewWriter(payload)
   err := writer.Close()
   if err != nil {
      fmt.Println(err)
      return
   }


   client := &http.Client {
   }
   req, err := http.NewRequest(method, url, payload)

   if err != nil {
      fmt.Println(err)
      return
   }
   req.Header.Set("Content-Type", writer.FormDataContentType())
   res, err := client.Do(req)
   if err != nil {
      fmt.Println(err)
      return
   }
   defer res.Body.Close()

   body, err := ioutil.ReadAll(res.Body)
   if err != nil {
      fmt.Println(err)
      return
   }
   fmt.Println(string(body))
}

OkHttpClient client = new OkHttpClient().newBuilder()
   .build();
MediaType mediaType = MediaType.parse("text/plain");
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, "{}");
Request request = new Request.Builder()
   .url("https://api.98ip.com/whitelist/add?ip=xxx.xx.xx.xx&appKey=xxx")
   .method("GET", body)
   .build();
Response response = client.newCall(request).execute();