Importing cookies into a profile
Please read the Material Usage Rules on this site.
Import cookies into a profile
Description: This method allows importing cookies into an existing profile in JSON format.
Request parameters:
| Parameter | Type | Format | Default | Description |
|---|---|---|---|---|
| workspaceId | integer | int64 | -1 | Workspace identifier. -1 means the default workspace. |
| profileId | string | uuid | (required) | The unique identifier of the target profile for cookie import (required). |
| body | JSON-Array | UUID profiles | Cookies in JSON format [cookie] |
Example request:
POST
CURL:
curl 'http://localhost:8160/v1/profiles/{profileId}/cookies/import' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Api-Token: YOUR_SECRET_TOKEN' \
--data '{}'
C#:
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("http://localhost:8160/v1/profiles/{profileId}/cookies/import"),
Headers =
{
{ "Api-Token", "YOUR_SECRET_TOKEN" },
},
Content = new StringContent("{}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
Cube:
http://localhost:8160/v1/profiles/{profileId}/cookies/import

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):
No content returned on successful import.
Error Response (500):
{
"message": null
}