CookieStore.AddCookie
  • 14 May 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

CookieStore.AddCookie

  • Dark
    Light
  • PDF

Article summary

Description

Adds a new cookie to an existing cookie store.

URL parameters

URL parameter ordering

The URL parameters below are listed in the order they should be entered in the API URL.

NameRequiredTypeDescription
CookieStoreIDTrue*numericUnique identifier of the cookie store.
CookieStoreNameTrue*stringThe name of the cookie store.
Cookie.DomainTruestringThe domain of the cookie.
Cookie.NameTruestringThe name of the cookie.
Cookie.ValueFalsestringThe value of the cookie.
Cookie.ExpiresFalsestringThe expiration date of format yyyy-MM-dd, yyyy-MM-dd hh:mm:ss, or in HTTP date-timestamp format.
Cookie.HttpOnlyFalsebooleanYes/True if the cookie is HttpOnly.
Cookie.SecureFalsebooleanYes/True if the cookie is secure.
Cookie.PathFalsestringThe cookie path.

* Either CookieStoreID or CookieStoreName is required.

Responses

NameTypeDescription
ResultstringSuccess if the operation is successful.

Sample request

curl -X GET 'https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=CookieStore.AddCookie&CookieStoreName=Lowes%20Cart&Cookie.Name=SetFromApi&Cookie.Domain=.mozenda.com&Cookie.Value=Test%20value%20from%20api'

Sample responses

XML

<?xml version="1.0" encoding="utf-8"?>
<CookieStoreAddCookieResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Result>Success</Result>
	<CookieStoreID>1006</CookieStoreID>
	<CookieID>1422</CookieID>
	<CookieName>SetFromApi</CookieName>
	<CookieDomain>.mozenda.com</CookieDomain>
	<CookiePath/>
</CookieStoreAddCookieResponse>

JSON (add &ResponseFormat=JSON)

{
    "CookieStoreID": 1001,
    "CookieID": 1001,
    "CookieName": "SetFromApi",
    "CookieDomain": "mozenda.com",
    "CookiePath": "",
    "JsonResult": {
        "Command": "CookieStore.AddCookie",
        "AutoLoggedIn": false,
        "WebConsoleKey": "",
        "Result": "Success",
        "ErrorCode": "",
        "ErrorDescription": "",
        "ErrorList": [],
        "ExecutionTime": {
            "Ticks": 0,
            "Days": 0,
            "Hours": 0,
            "Milliseconds": 0,
            "Minutes": 0,
            "Seconds": 0,
            "TotalDays": 0,
            "TotalHours": 0,
            "TotalMilliseconds": 0,
            "TotalMinutes": 0,
            "TotalSeconds": 0
        }
    }
}

Was this article helpful?