Skip to main content

Adding New Proxy

Description: This method is used to add a new proxy entry using the provided configuration parameters. It returns the generated unique identifier.

Request parameters:

ParameterTypeFormatDefaultDescription
namestring(empty)Name of the added proxy. This value cannot be null or empty.
proxyUrlstring(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).
workspaceIdintegerint64-1Workspace identifier. -1 means the default workspace.
folderIdstringuuid(empty)Optional identifier of the folder to associate with the proxy. Can take null value.
ipChangeUrlstring(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 codeResult
200 OKSuccess
500 ErrorInternal 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
}