Adding a New Proxy
Please read the Material Usage Rules on this site.
Description: This method is used to add a new proxy entry using the provided configuration parameters. It returns the generated unique identifier.
Request parameters:
| Parameter | Type | Format | Default | Description |
|---|---|---|---|---|
| name | string | (empty) | Name of the added proxy. This value cannot be null or empty. | |
| proxyUri | string | (empty) | URL-address of the proxy. Must be a valid URL (e.g., http://login:pass@host:port). | |
| workspaceId | integer | int64 | -1 | Workspace identifier. -1 means the default workspace. |
| folderId | string | uuid | (empty) | Identifier of the folder to associate with the proxy (optional). Defaults to null. |
| ipChangeUrl | string | (empty) | URL to trigger IP change for the proxy (optional). Defaults to empty. |
Example request:
POST
CURL:
curl 'http://localhost:8160/v1/proxies/create?name=ApiEntity&proxyUri=http%3A%2F%2Flogin%3Apass%40127.0.0.1%3A8080&workspaceId=-1&folderId=123e4567-e89b-12d3-a456-426614174000&ipChangeUrl=https%3A%2F%2Fexample.com%2Fchange-ip' \
--request POST \
--header 'Api-Token: YOUR_SECRET_TOKEN'
C#:
using System.Text;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("http://localhost:8160/v1/proxies/create?name=ApiEntity&proxyUri=http%3A%2F%2Flogin%3Apass%40127.0.0.1%3A8080&workspaceId=-1&folderId=123e4567-e89b-12d3-a456-426614174000&ipChangeUrl=https%3A%2F%2Fexample.com%2Fchange-ip"),
Headers =
{
{ "Api-Token", "YOUR_SECRET_TOKEN" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
Cube:
http://localhost:8160/v1/proxies/create?name=&proxyUri=&workspaceId=&folderId=&ipChangeUrl=

Additionally:
User-Agent: {-Profile.UserAgent-}
Api-Token: Token from UserArea2.

Response API:
| Response code | Result |
|---|---|
200 OK | OK |
401 Unauthorized | Unauthorized |
403 Forbidden | Forbidden |
500 Internal Server Error | Internal Server Error |
Success Response (200 OK):
123e4567-e89b-12d3-a456-426614174000
Error Response (500):
{
"message": null
}