GlobalMobileProxies
Buy New Proxy Add Balance
GB

Documentation

Choose your language below

icon-python

Python

icon-php

PHP

icon-node

NodeJS

icon-java

Java

icon-ruby

Ruby

icon-go

GO

CTRL+K

Authentication

API Key Authentication

This section elucidates the authentication procedure essential for accessing the Global Mobile Proxies API.

To authenticate requests to the Global Mobile Proxies API, you need to include your API key in the request header, which should be formatted as follows.

Authorization: Token ba536fc4ad403da06849e3dbf0975e64b428
Example Usage
import requests

url = 'https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change'
apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'
data = {
    'location': 'New York'
}

headers = {
    'Authorization': 'Token ' + apiKey,
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, json=data)

print(response.text)
<?php

$url = 'https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change';
$apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
$data = array(
    'location' => 'New York'
);

$headers = array(
    'Authorization: Token ' . $apiKey,
    'Content-Type: application/json'
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

if(curl_errno($ch)){
    echo 'Curl error: ' . curl_error($ch);
}

curl_close($ch);

echo $response;

?>
const axios = require('axios');

const url = 'https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change';
const apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
const data = {
    location: 'New York'
};

const headers = {
    Authorization: 'Token ' + apiKey,
    'Content-Type': 'application/json'
};

axios.post(url, data, { headers })
.then(response => {
    console.log(response.data);
})
.catch(error => {
    console.error('Error:', error);
});
import okhttp3.*;

  public class Main {
      public static void main(String[] args) {
          OkHttpClient client = new OkHttpClient();
  
          String url = "https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change";
          String apiKey = "ba536fc4ad403da06849e3dbf0975e64b428";
          String json = "{\"location\": \"New York\"}";
  
          MediaType mediaType = MediaType.parse("application/json");
          RequestBody body = RequestBody.create(json, mediaType);
  
          Request request = new Request.Builder()
                  .url(url)
                  .post(body)
                  .addHeader("Authorization", "Token " + apiKey)
                  .addHeader("Content-Type", "application/json")
                  .build();
  
          try {
              Response response = client.newCall(request).execute();
              System.out.println(response.body().string());
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
require 'httparty'

url = 'https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change'
api_key = 'ba536fc4ad403da06849e3dbf0975e64b428'
data = { location: 'New York' }

headers = {
  'Authorization' => "Token #{api_key}",
  'Content-Type' => 'application/json'
}

response = HTTParty.post(url, body: data.to_json, headers: headers)

puts response.body
package main

import (
  "bytes"
  "encoding/json"
  "fmt"
  "net/http"
)

func main() {
  url := "https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change"
  apiKey := "ba536fc4ad403da06849e3dbf0975e64b428"
  data := map[string]string{"location": "New York"}

  payload, err := json.Marshal(data)
  if err != nil {
    fmt.Println("Error marshalling JSON:", err)
    return
  }

  req, err := http.NewRequest("POST", url, bytes.NewBuffer(payload))
  if err != nil {
    fmt.Println("Error creating request:", err)
    return
  }

  req.Header.Set("Content-Type", "application/json")
  req.Header.Set("Authorization", "Token "+apiKey)

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil {
    fmt.Println("Error making request:", err)
    return
  }
  defer resp.Body.Close()

  fmt.Println("Response Status:", resp.Status)

  // Read the response body if needed
  // body, err := ioutil.ReadAll(resp.Body)
  // if err != nil {
  // 	fmt.Println("Error reading response body:", err)
  // 	return
  // }
  // fmt.Println("Response Body:", string(body))
}

The API token for Global Mobile Proxies provides a secure means to authenticate your requests instead of using your credentials (such as email address and password) when interacting with Global Mobile Proxies' API.

  • Go to your account dashboard.
  • Navigate to the API section.
  • The API settings will be displayed. Be sure to keep the API token in a secure location.

    api-key

If you forget your API token or it expires, you can refresh it by hovering over the token row and clicking the "Issue new API key" button.

Proxy Operations

Change Proxy IP

This endpoint allows you to change the IP address of a proxy. It can be used once every 3 minutes.

GEThttps://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip/change
Request & Response
import requests

url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip/change'
apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'
headers = {
    'Authorization': 'Token ' + apiKey
}

response = requests.get(url, headers=headers)

print(response.text)
<?php

$url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip/change';
$apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';

$headers = array(
    'Authorization: Token ' . $apiKey
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

if(curl_errno($ch)){
    echo 'Curl error: ' . curl_error($ch);
}

curl_close($ch);

echo $response;

?>
const axios = require('axios');

const url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip/change';
const apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
const headers = {
    'Authorization': 'Token ' + apiKey
};

axios.get(url, { headers })
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error('Error:', error);
    });
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        String url = "https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip/change";
        String apiKey = "ba536fc4ad403da06849e3dbf0975e64b428";

        Request request = new Request.Builder()
                .url(url)
                .get()
                .addHeader("Authorization", "Token " + apiKey)
                .build();

        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
require 'httparty'

url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip/change'
apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'
headers = {
  'Authorization' => "Token #{apiKey}"
}

response = HTTParty.get(url, headers: headers)

puts response.body
package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	url := "https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip/change"
	apiKey := "ba536fc4ad403da06849e3dbf0975e64b428"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		fmt.Println("Error creating request:", err)
		return
	}
	req.Header.Set("Authorization", "Token "+apiKey)

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error making request:", err)
		return
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("Error reading response body:", err)
		return
	}

	fmt.Println(string(body))
}

Change Proxy Location

This endpoint enables you to change the location of a proxy. If the location parameter is omitted, a random location is chosen. This operation can be performed once every 3 minutes.

POSThttps://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/location/change
Parameters
Attributes Types Description
location string The desired location for the proxy.

Please note that the location parameter should be provided as a string indicating the desired location, such as "New York" or "London". Ensure that the location name is spelled correctly and matches one of the available locations supported by the Global Mobile Proxies service.

Request & Response
import requests

  url = 'https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change'
  apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'
  data = {
      'location': 'New York'
  }
  
  headers = {
      'Authorization': 'Token ' + apiKey,
      'Content-Type': 'application/json'
  }
  
  response = requests.post(url, headers=headers, json=data)
  
  print(response.text)
<?php

$url = 'https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change';
$apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
$data = array(
    'location' => 'New York'
);

$headers = array(
    'Authorization: Token ' . $apiKey,
    'Content-Type: application/json'
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

if(curl_errno($ch)){
    echo 'Curl error: ' . curl_error($ch);
}

curl_close($ch);

echo $response;

?>
const axios = require('axios');

const url = 'https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change';
const apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
const data = {
    location: 'New York'
};

const headers = {
    Authorization: 'Token ' + apiKey,
    'Content-Type': 'application/json'
};

axios.post(url, data, { headers })
.then(response => {
    console.log(response.data);
})
.catch(error => {
    console.error('Error:', error);
});
import okhttp3.*;

  public class Main {
      public static void main(String[] args) {
          OkHttpClient client = new OkHttpClient();
  
          String url = "https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change";
          String apiKey = "ba536fc4ad403da06849e3dbf0975e64b428";
          String json = "{\"location\": \"New York\"}";
  
          MediaType mediaType = MediaType.parse("application/json");
          RequestBody body = RequestBody.create(json, mediaType);
  
          Request request = new Request.Builder()
                  .url(url)
                  .post(body)
                  .addHeader("Authorization", "Token " + apiKey)
                  .addHeader("Content-Type", "application/json")
                  .build();
  
          try {
              Response response = client.newCall(request).execute();
              System.out.println(response.body().string());
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  }
require 'httparty'

url = 'https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change'
api_key = 'ba536fc4ad403da06849e3dbf0975e64b428'
data = { location: 'New York' }

headers = {
  'Authorization' => "Token #{api_key}",
  'Content-Type' => 'application/json'
}

response = HTTParty.post(url, body: data.to_json, headers: headers)

puts response.body
package main

import (
  "bytes"
  "encoding/json"
  "fmt"
  "net/http"
)

func main() {
  url := "https://globalmobileproxies.com/api/v1/hui9r0vj1y.MyProxy-1/location/change"
  apiKey := "ba536fc4ad403da06849e3dbf0975e64b428"
  data := map[string]string{"location": "New York"}

  payload, err := json.Marshal(data)
  if err != nil {
    fmt.Println("Error marshalling JSON:", err)
    return
  }

  req, err := http.NewRequest("POST", url, bytes.NewBuffer(payload))
  if err != nil {
    fmt.Println("Error creating request:", err)
    return
  }

  req.Header.Set("Content-Type", "application/json")
  req.Header.Set("Authorization", "Token "+apiKey)

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil {
    fmt.Println("Error making request:", err)
    return
  }
  defer resp.Body.Close()

  fmt.Println("Response Status:", resp.Status)

  // Read the response body if needed
  // body, err := ioutil.ReadAll(resp.Body)
  // if err != nil {
  // 	fmt.Println("Error reading response body:", err)
  // 	return
  // }
  // fmt.Println("Response Body:", string(body))
}

List Available Locations

This endpoint retrieves a list of available proxy locations. It can be used to retrieve the available locations and assist in changing a proxy's location.

GEThttps://globalmobileproxies.com/api/v1/locations/get
Request & Response
import requests

url = 'https://globalmobileproxies.com/api/v1/locations/get'
apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'

headers = {
    'Authorization': 'Token ' + apiKey
}

response = requests.get(url, headers=headers)

print(response.text)
<?php

$url = 'https://globalmobileproxies.com/api/v1/locations/get';
$apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';

$headers = array(
    'Authorization: Token ' . $apiKey
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

if(curl_errno($ch)){
    echo 'Curl error: ' . curl_error($ch);
}

curl_close($ch);

echo $response;

?>
const axios = require('axios');

const url = 'https://globalmobileproxies.com/api/v1/locations/get';
const apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
const headers = {
    'Authorization': 'Token ' + apiKey
};

axios.get(url, { headers })
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error('Error:', error);
    });
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        String url = "https://globalmobileproxies.com/api/v1/locations/get";
        String apiKey = "ba536fc4ad403da06849e3dbf0975e64b428";

        Request request = new Request.Builder()
                .url(url)
                .get()
                .addHeader("Authorization", "Token " + apiKey)
                .build();

        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
require 'httparty'

url = 'https://globalmobileproxies.com/api/v1/locations/get'
apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'
headers = {
  'Authorization' => "Token #{apiKey}"
}

response = HTTParty.get(url, headers: headers)

puts response.body
package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	url := "https://globalmobileproxies.com/api/v1/locations/get"
	apiKey := "ba536fc4ad403da06849e3dbf0975e64b428"

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		fmt.Println("Error creating request:", err)
		return
	}
	req.Header.Set("Authorization", "Token "+apiKey)

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error making request:", err)
		return
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("Error reading response body:", err)
		return
	}

	fmt.Println(string(body))
}

Change Proxy IP Rotation

This endpoint allows you to adjust the IP rotation settings of a proxy. The minimum rotation interval is 180 seconds.

POSThttps://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip-rotation/change
Parameters
Attributes Types Description
hours integer The number of hours for IP rotation.
minutes integer The number of minutes for IP rotation.

These parameters specify the duration for the IP rotation of the proxy. The combination of hours and minutes determines how frequently the IP rotation will occur. Adjust these values according to your requirements.

Request & Response
import requests

url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip-rotation/change'
apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'
data = {
    'hours': 1,
    'minutes': 5
}

headers = {
    'Authorization': 'Token ' + apiKey,
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, json=data)

print(response.text)
<?php

$url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip-rotation/change';
$apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
$data = array(
    'hours' => 1,
    'minutes' => 5
);

$headers = array(
    'Authorization: Token ' . $apiKey,
    'Content-Type: application/json'
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);

if(curl_errno($ch)){
    echo 'Curl error: ' . curl_error($ch);
}

curl_close($ch);

echo $response;

?>
const axios = require('axios');

const url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip-rotation/change';
const apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
const data = {
    'hours': 1,
    'minutes': 5
};

const headers = {
    'Authorization': `Token ${apiKey}`,
    'Content-Type': 'application/json'
};

axios.post(url, data, { headers })
.then(response => {
    console.log(response.data);
})
.catch(error => {
    console.error('Error:', error);
});
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        OkHttpClient client = new OkHttpClient();

        String url = "https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip-rotation/change";
        String apiKey = "ba536fc4ad403da06849e3dbf0975e64b428";
        String json = "{\"hours\": 1, \"minutes\": 5}";

        RequestBody body = RequestBody.create(MediaType.parse("application/json"), json);

        Request request = new Request.Builder()
                .url(url)
                .post(body)
                .addHeader("Authorization", "Token " + apiKey)
                .build();

        try {
            Response response = client.newCall(request).execute();
            System.out.println(response.body().string());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
require 'httparty'

url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip-rotation/change'
apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'
data = {
    'hours': 1,
    'minutes': 5
}

headers = {
    'Authorization' => "Token #{apiKey}",
    'Content-Type' => 'application/json'
}

response = HTTParty.post(url, headers: headers, body: data.to_json)

puts response.body
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	url := "https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ip-rotation/change"
	apiKey := "ba536fc4ad403da06849e3dbf0975e64b428"
	data := map[string]int{
		"hours":   1,
		"minutes": 5,
	}

	jsonData, err := json.Marshal(data)
	if err != nil {
		fmt.Println("Error marshaling JSON:", err)
		return
	}

	req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
	if err != nil {
		fmt.Println("Error creating request:", err)
		return
	}
	req.Header.Set("Authorization", "Token "+apiKey)
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error making request:", err)
		return
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("Error reading response body:", err)
		return
	}

	fmt.Println(string(body))
}

Change Proxy IPv4 Whitelist

This endpoint allows you to modify the IPv4 whitelist of a proxy. You can either set or append IP addresses to the whitelist.

POSThttps://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ipv4/change
Parameters
Attributes Types Description
operation string The operation to perform on the whitelist. Valid values are 'set' or 'append'.
whitelist string The list of IPv4 addresses to add to the whitelist. Separate addresses with commas.
Request & Response
import requests

url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ipv4/change'
apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'
data = {
    'operation': 'append',
    'whitelist': '123.123.123.123, 123.123.123.124'
}

headers = {
    'Authorization': 'Token ' + apiKey,
    'Content-Type': 'application/json'
}

response = requests.post(url, headers=headers, json=data)

print(response.text)
<?php

$url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ipv4/change';
$apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
$data = array(
    'operation' => 'append',
    'whitelist' => '123.123.123.123, 123.123.123.124'
);

$headers = array(
    'Authorization: Token ' . $apiKey,
    'Content-Type: application/json'
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>
const axios = require('axios');

const url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ipv4/change';
const apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428';
const data = {
    'operation': 'append',
    'whitelist': '123.123.123.123, 123.123.123.124'
};

const headers = {
    'Authorization': `Token ${apiKey}`,
    'Content-Type': 'application/json'
};

axios.post(url, data, { headers })
.then(response => {
    console.log(response.data);
})
.catch(error => {
    console.error('Error:', error);
});
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class IPWhitelist {
    public static void main(String[] args) {
        try {
            String apiKey = "ba536fc4ad403da06849e3dbf0975e64b428";
            String url = "https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ipv4/change";
            String whitelistData = "{\"operation\": \"append\", \"whitelist\": \"123.123.123.123, 123.123.123.124\"}";

            // Set up HTTP connection
            URL apiUrl = new URL(url);
            HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Authorization", "Token " + apiKey);
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setDoOutput(true);

            // Send request body
            OutputStream outputStream = connection.getOutputStream();
            outputStream.write(whitelistData.getBytes());
            outputStream.flush();

            // Get response
            int responseCode = connection.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                // Process successful response
                System.out.println("IP whitelist updated successfully.");
            } else {
                // Handle error response
                System.out.println("Failed to update IP whitelist. Response code: " + responseCode);
            }

            // Close resources
            outputStream.close();
            connection.disconnect();
        } catch (Exception e) {
            // Handle exceptions
            e.printStackTrace();
        }
    }
}
require 'httparty'

url = 'https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ipv4/change'
apiKey = 'ba536fc4ad403da06849e3dbf0975e64b428'
data = {
    'operation': 'append',
    'whitelist': '123.123.123.123, 123.123.123.124'
}

headers = {
    'Authorization' => "Token #{apiKey}",
    'Content-Type' => 'application/json'
}

response = HTTParty.post(url, headers: headers, body: data.to_json)

puts response.body
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	url := "https://globalmobileproxies.com/api/v1/ww_john.MyProxy-1/ipv4/change"
	apiKey := "ba536fc4ad403da06849e3dbf0975e64b428"
	data := map[string]string{
		"operation": "append",
		"whitelist": "123.123.123.123, 123.123.123.124",
	}

	jsonData, err := json.Marshal(data)
	if err != nil {
		fmt.Println("Error marshaling JSON:", err)
		return
	}

	req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
	if err != nil {
		fmt.Println("Error creating request:", err)
		return
	}
	req.Header.Set("Authorization", "Token "+apiKey)
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		fmt.Println("Error making request:", err)
		return
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		fmt.Println("Error reading response body:", err)
		return
	}

	fmt.Println(string(body))
}