Adding 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. | |
| proxyUrl | string | (empty) | URL-address of the proxy. This value must be a valid URL. (cannot be null or empty, for example http://login:pass@host:port). | |
| workspaceId | integer | int64 | -1 | Workspace identifier. -1 means the default workspace. |
| folderId | string | uuid | (empty) | Optional identifier of the folder to associate with the proxy. Can take null value. |
| ipChangeUrl | string | (empty) | Optional URL to trigger IP change for the proxy. Defaults to an empty string if not specified. |
Example request:
POST
CURL:
curl 'http://localhost:8160/v1/proxies/create?name=&proxyUri=&workspaceId=&folderId=&ipChangeUrl=' \
--request POST \
--header 'Api-Token: YOUR_SECRET_TOKEN'
C#:
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("http://localhost:8160/v1/proxies/create?name=&proxyUri=&workspaceId=&folderId=&ipChangeUrl="),
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 | Success |
500 Error | Internal Server Error |
Success Response (200 OK):
Returns an array containing the ID of the newly created proxy:
[
"123e4567-e89b-12d3-a456-426614174000"
]
Error Response (500):
{
"message": null
}