Skip to main content

Adding a 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.
proxyUristring(empty)URL-address of the proxy. Must be a valid URL (e.g., http://login:pass@host:port).
workspaceIdintegerint64-1Workspace identifier. -1 means the default workspace.
folderIdstringuuid(empty)Identifier of the folder to associate with the proxy (optional). Defaults to null.
ipChangeUrlstring(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 codeResult
200 OKOK
401 UnauthorizedUnauthorized
403 ForbiddenForbidden
500 Internal Server ErrorInternal Server Error

Success Response (200 OK):

123e4567-e89b-12d3-a456-426614174000

Error Response (500):

{
"message": null
}