General
Общие операции (профиль, заказы, справочники)
Создать и оплатить заказ
https://user-api.proxyshard.com/user/api/orders/purchaseПокупка по имени продукта, локации и циклу. Для Datacenter/ISP; location обязателен. Для Standart Residential Proxy; location не требуется.
Bearer authentication header of the form Bearer <token>.
200Успешноapplication/json
400Ошибка валидации/баланса/недостаток стокаapplication/json
401Неавторизованapplication/json
/user/api/orders/purchasePOST /user/api/orders/purchase HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
{
"product": "Datacenter Proxy",
"location": "text",
"cycle": "text",
"quantity": 1,
"promo_code": "text",
"auto_renewal": false,
"addons": [
{
"addon_key": "p0f_slots",
"qty": 1
}
]
}curl -X POST 'https://user-api.proxyshard.com/user/api/orders/purchase' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"product":"Datacenter Proxy","location":"text","cycle":"text","quantity":1,"promo_code":"text","auto_renewal":false,"addons":[{"addon_key":"p0f_slots","qty":1}]}'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/orders/purchase"
headers = {
"Authorization": f"Bearer {token}",
}
payload = {
"product": "Datacenter Proxy",
"location": "text",
"cycle": "text",
"quantity": 1,
"promo_code": "text",
"auto_renewal": False,
"addons": [
{
"addon_key": "p0f_slots",
"qty": 1,
},
],
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/orders/purchase";
const payload = {
"product": "Datacenter Proxy",
"location": "text",
"cycle": "text",
"quantity": 1,
"promo_code": "text",
"auto_renewal": false,
"addons": [
{
"addon_key": "p0f_slots",
"qty": 1
}
]
};
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log(response.status);
console.log(await response.text());package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/orders/purchase"
body := bytes.NewBufferString(`{
"product": "Datacenter Proxy",
"location": "text",
"cycle": "text",
"quantity": 1,
"promo_code": "text",
"auto_renewal": false,
"addons": [
{
"addon_key": "p0f_slots",
"qty": 1
}
]
}`)
req, err := http.NewRequest("POST", url, body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.proxyshard.com/user/api/orders/purchase")
.header("Authorization", format!("Bearer {token}"))
.json(&serde_json::json!({
"product": "Datacenter Proxy",
"location": "text",
"cycle": "text",
"quantity": 1,
"promo_code": "text",
"auto_renewal": false,
"addons": [
{
"addon_key": "p0f_slots",
"qty": 1
}
]
}))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.proxyshard.com/user/api/orders/purchase");
request.Content = new StringContent("""
{
"product": "Datacenter Proxy",
"location": "text",
"cycle": "text",
"quantity": 1,
"promo_code": "text",
"auto_renewal": false,
"addons": [
{
"addon_key": "p0f_slots",
"qty": 1
}
]
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
headers = curl_slist_append(headers, "Content-Type: application/json");
const std::string body = R"json({
"product": "Datacenter Proxy",
"location": "text",
"cycle": "text",
"quantity": 1,
"promo_code": "text",
"auto_renewal": false,
"addons": [
{
"addon_key": "p0f_slots",
"qty": 1
}
]
})json";
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/purchase");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "text",
"order_id": 1
}{
"success": true,
"message": "text"
}{
"success": true,
"message": "text"
}Рассчитать стоимость заказа
https://user-api.proxyshard.com/user/api/orders/calculateРассчитывает цену по названию продукта, названию цикла и количеству. Использует те же правила проверки, что и при покупке (разрешенные платежные циклы, правила промоакций).
Bearer authentication header of the form Bearer <token>.
Массив дополнений в URL-кодированном JSON, например [{"addon_key":"p0f_slots","qty":5}]
200Успехapplication/json
Общая стоимость дополнений в минимальных единицах
final_price + addons_price
400Ошибка проверкиapplication/json
401Требуется авторизацияapplication/json
/user/api/orders/calculate?product=textGET /user/api/orders/calculate?product=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.proxyshard.com/user/api/orders/calculate?product=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/orders/calculate"
params = {
"product": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/orders/calculate?product=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/orders/calculate?product=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.proxyshard.com/user/api/orders/calculate?product=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.proxyshard.com/user/api/orders/calculate?product=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/calculate?product=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"original_price": 1,
"final_price": 1,
"discount_percent": 1,
"addons_price": 1,
"total_with_addons": 1
}{
"success": true,
"message": "text"
}{
"success": true,
"message": "text"
}Изменить биллинг-цикл заказа
https://user-api.proxyshard.com/user/api/orders/change-billing-cycle/{order_id}Меняет цикл оплаты по названию цикла. Только для Datacenter & ISP прокси. Если промокод недоступен для выбранного цикла, он будет автоматически сброшен.
Bearer authentication header of the form Bearer <token>.
200Успешноapplication/json
400Неверный продукт или циклapplication/json
401Неавторизованapplication/json
403Цикл недоступен для этого пользователяapplication/json
/user/api/orders/change-billing-cycle/1POST /user/api/orders/change-billing-cycle/1 HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
{
"cycle": "text"
}curl -X POST 'https://user-api.proxyshard.com/user/api/orders/change-billing-cycle/1' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"cycle":"text"}'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/orders/change-billing-cycle/1"
headers = {
"Authorization": f"Bearer {token}",
}
payload = {
"cycle": "text",
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/orders/change-billing-cycle/1";
const payload = {
"cycle": "text"
};
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log(response.status);
console.log(await response.text());package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/orders/change-billing-cycle/1"
body := bytes.NewBufferString(`{
"cycle": "text"
}`)
req, err := http.NewRequest("POST", url, body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.proxyshard.com/user/api/orders/change-billing-cycle/1")
.header("Authorization", format!("Bearer {token}"))
.json(&serde_json::json!({
"cycle": "text"
}))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.proxyshard.com/user/api/orders/change-billing-cycle/1");
request.Content = new StringContent("""
{
"cycle": "text"
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
headers = curl_slist_append(headers, "Content-Type: application/json");
const std::string body = R"json({
"cycle": "text"
})json";
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/change-billing-cycle/1");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "text",
"order_id": 1,
"original_price": 1,
"final_price": 1,
"discount_percent": 1
}{
"success": true,
"message": "text"
}{
"success": true,
"message": "text"
}{
"success": true,
"message": "text"
}Изменить авто-продление заказа
https://user-api.proxyshard.com/user/api/orders/edit-auto-renewal/{order_id}Включить/выключить авто-продление. Только для Datacenter & ISP прокси.
Bearer authentication header of the form Bearer <token>.
200Успешноapplication/json
400Неверный продукт для операцииapplication/json
401Неавторизованapplication/json
/user/api/orders/edit-auto-renewal/1?auto_renewal=truePOST /user/api/orders/edit-auto-renewal/1?auto_renewal=true HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X POST 'https://user-api.proxyshard.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/orders/edit-auto-renewal/1"
params = {
"auto_renewal": "true",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.post(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true";
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true"
req, err := http.NewRequest("POST", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.proxyshard.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.proxyshard.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/edit-auto-renewal/1?auto_renewal=true");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "text"
}{
"success": true,
"message": "text"
}{
"success": true,
"message": "text"
}Получить продукты и их циклы
https://user-api.proxyshard.com/user/api/proxies/productsВозвращает продукты для API с названиями доступных циклов.
Bearer authentication header of the form Bearer <token>.
200Список продуктовapplication/json
productsobject · ProductWithCycles[]requiredShow propertiesHide properties
/user/api/proxies/productsGET /user/api/proxies/products HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.proxyshard.com/user/api/proxies/products' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/proxies/products"
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/proxies/products";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/proxies/products"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.proxyshard.com/user/api/proxies/products")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.proxyshard.com/user/api/proxies/products");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/proxies/products");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"products": [
{
"name": "text",
"description": "text",
"location": "text",
"cycles": [
"text"
]
}
]
}Получить доступное количество прокси
https://user-api.proxyshard.com/user/api/proxies/available-countВозвращает суммарное доступное количество для всех продуктов.
Bearer authentication header of the form Bearer <token>.
200Успешноapplication/json
/user/api/proxies/available-countGET /user/api/proxies/available-count HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.proxyshard.com/user/api/proxies/available-count' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/proxies/available-count"
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/proxies/available-count";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/proxies/available-count"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.proxyshard.com/user/api/proxies/available-count")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.proxyshard.com/user/api/proxies/available-count");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/proxies/available-count");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}[
{
"country": "text",
"product": "text",
"amount": 1
}
]Информация о пользователе
https://user-api.proxyshard.com/user/api/meBearer authentication header of the form Bearer <token>.
200Данные профиляapplication/json
в центах
/user/api/meGET /user/api/me HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.proxyshard.com/user/api/me' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/me"
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/me";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/me"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.proxyshard.com/user/api/me")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.proxyshard.com/user/api/me");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/me");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"email": "text",
"active_orders": 1,
"wallet_balance": 1
}Список заказов
https://user-api.proxyshard.com/user/api/ordersBearer authentication header of the form Bearer <token>.
активный | в ожидании | отменен | все
Смещение выборки (по умолчанию 0)
Размер страницы (1..100, по умолчанию 20)
200Список заказовapplication/json
ordersobject[]requiredShow propertiesHide properties
ISO8601 время истечения
Количество заказов в текущей выборке
URI предыдущей страницы
URI следующей страницы
/user/api/orders?status=textGET /user/api/orders?status=text HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.proxyshard.com/user/api/orders?status=text' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/orders"
params = {
"status": "text",
}
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, params=params, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/orders?status=text";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/orders?status=text"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.proxyshard.com/user/api/orders?status=text")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.proxyshard.com/user/api/orders?status=text");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders?status=text");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"orders": [
{
"order_id": 1,
"product_id": 1,
"product_name": "text",
"cycle_id": 1,
"cycle_name": "text",
"expires_at": "text",
"auto_renewal": true,
"tag": "text"
}
],
"count": 1,
"prev": "text",
"next": "text"
}Получить информацию о заказе
https://user-api.proxyshard.com/user/api/orders/{id}Bearer authentication header of the form Bearer <token>.
200Информация о заказеapplication/json
orderobjectrequiredShow propertiesHide properties
Базовая цена подписки в центах
Общая дополнительная стоимость в центах
addonsobject · AddonLine[]optionalДополнительные строки, прикрепленные к этому заказу
Show propertiesHide properties
Дополнительные строки, прикрепленные к этому заказу
Активные единицы за текущий период
Цена за единицу в центах на момент покупки
pendingobject· nullableoptionalИзменение запланировано на следующее продление или null
Show propertiesHide properties
Изменение запланировано на следующее продление или null
canceldowngradeЦелевое количество после понижения
Активные слоты для подписи p0f (из дополнений)
Слоты, в настоящее время занятые подписанными прокси
Слоты, которые будут активны после следующего продления
/user/api/orders/1GET /user/api/orders/1 HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X GET 'https://user-api.proxyshard.com/user/api/orders/1' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/orders/1"
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.get(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/orders/1";
const response = await fetch(url, {
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/orders/1"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.get("https://user-api.proxyshard.com/user/api/orders/1")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Get, "https://user-api.proxyshard.com/user/api/orders/1");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/1");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"order": {
"order_id": 1,
"product_name": "text",
"cycle_name": "text",
"quantity": 1,
"price_paid": 1,
"addons_price_paid": 1,
"addons": [
{
"addon_key": "text",
"catalog_id": 1,
"qty": 1,
"price_per_unit": 1,
"pending": {
"action": "cancel",
"next_qty": 1
}
}
],
"p0f_slots_available": 1,
"p0f_slots_used": 1,
"p0f_slots_next": 1,
"status": "text",
"created_at": "text",
"expires_at": "text",
"promo_code": "text",
"auto_renewal": true,
"tag": "text"
}
}Продлить заказ
https://user-api.proxyshard.com/user/api/orders/{id}/renewПродление доступно только при статусе заказа on-hold.
Bearer authentication header of the form Bearer <token>.
200Успешноapplication/json
400Недостаточный баланс/валидацияapplication/json
/user/api/orders/1/renewPOST /user/api/orders/1/renew HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*curl -X POST 'https://user-api.proxyshard.com/user/api/orders/1/renew' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/orders/1/renew"
headers = {
"Authorization": f"Bearer {token}",
}
response = requests.post(url, headers=headers, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/orders/1/renew";
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
},
});
console.log(response.status);
console.log(await response.text());package main
import (
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/orders/1/renew"
req, err := http.NewRequest("POST", url, nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.proxyshard.com/user/api/orders/1/renew")
.header("Authorization", format!("Bearer {token}"))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.proxyshard.com/user/api/orders/1/renew");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/1/renew");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "Order renewed successfully"
}{
"success": true,
"message": "text"
}Изменить тег заказа
https://user-api.proxyshard.com/user/api/orders/{id}/tagBearer authentication header of the form Bearer <token>.
200Успешноapplication/json
/user/api/orders/1/tagPOST /user/api/orders/1/tag HTTP/1.1
Host: user-api.proxyshard.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
{
"tag": "text"
}curl -X POST 'https://user-api.proxyshard.com/user/api/orders/1/tag' \
-H 'Authorization: Bearer YOUR_SECRET_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"tag":"text"}'import requests
# API token — see Authorizations above.
token = "YOUR_SECRET_TOKEN"
url = "https://user-api.proxyshard.com/user/api/orders/1/tag"
headers = {
"Authorization": f"Bearer {token}",
}
payload = {
"tag": "text",
}
response = requests.post(url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.status_code)
print(response.text)// API token — see Authorizations above.
const token = "YOUR_SECRET_TOKEN";
const url = "https://user-api.proxyshard.com/user/api/orders/1/tag";
const payload = {
"tag": "text"
};
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
});
console.log(response.status);
console.log(await response.text());package main
import (
"bytes"
"fmt"
"io"
"log"
"net/http"
)
func main() {
// API token — see Authorizations above.
token := "YOUR_SECRET_TOKEN"
url := "https://user-api.proxyshard.com/user/api/orders/1/tag"
body := bytes.NewBufferString(`{
"tag": "text"
}`)
req, err := http.NewRequest("POST", url, body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
out, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp.Status)
fmt.Println(string(out))
}// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, tokio = { version = "1", features = ["full"] }, serde_json = "1"
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// API token — see Authorizations above.
let token = "YOUR_SECRET_TOKEN";
let client = reqwest::Client::new();
let response = client
.post("https://user-api.proxyshard.com/user/api/orders/1/tag")
.header("Authorization", format!("Bearer {token}"))
.json(&serde_json::json!({
"tag": "text"
}))
.send()
.await?;
println!("{}", response.status());
println!("{}", response.text().await?);
Ok(())
}using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
// API token — see Authorizations above.
var token = "YOUR_SECRET_TOKEN";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var request = new HttpRequestMessage(HttpMethod.Post, "https://user-api.proxyshard.com/user/api/orders/1/tag");
request.Content = new StringContent("""
{
"tag": "text"
}
""", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}// build: c++ -std=c++17 main.cpp -lcurl
#include <curl/curl.h>
#include <iostream>
#include <string>
static size_t write_cb(char *ptr, size_t size, size_t nmemb, void *userdata) {
static_cast<std::string *>(userdata)->append(ptr, size * nmemb);
return size * nmemb;
}
int main() {
// API token — see Authorizations above.
const std::string token = "YOUR_SECRET_TOKEN";
curl_global_init(CURL_GLOBAL_DEFAULT);
CURL *curl = curl_easy_init();
if (!curl) {
std::cerr << "curl_easy_init failed\n";
curl_global_cleanup();
return 1;
}
struct curl_slist *headers = nullptr;
headers = curl_slist_append(headers, ("Authorization: Bearer " + token).c_str());
headers = curl_slist_append(headers, "Content-Type: application/json");
const std::string body = R"json({
"tag": "text"
})json";
std::string response;
curl_easy_setopt(curl, CURLOPT_URL, "https://user-api.proxyshard.com/user/api/orders/1/tag");
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body.c_str());
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, static_cast<long>(body.size()));
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
const CURLcode rc = curl_easy_perform(curl);
if (rc != CURLE_OK) {
std::cerr << curl_easy_strerror(rc) << "\n";
} else {
long status = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
std::cout << status << "\n" << response << "\n";
}
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
curl_global_cleanup();
return rc == CURLE_OK ? 0 : 1;
}{
"success": true,
"message": "Order tag updated"
}Обновлено