CookieStore.AddCookie
  • 25 May 2021
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

CookieStore.AddCookie

  • Dark
    Light
  • PDF

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.

Name Required Type Description
CookieStoreID True* numeric Unique identifier of the cookie store.
CookieStoreName True* string The name of the cookie store.
Cookie.Domain True string The domain of the cookie.
Cookie.Name True string The name of the cookie.
Cookie.Value False string The value of the cookie.
Cookie.Expires False string The expiration date of format yyyy-MM-dd, yyyy-MM-dd hh:mm:ss, or in HTTP date-timestamp format.
Cookie.HttpOnly False boolean Yes/True if the cookie is HttpOnly.
Cookie.Secure False boolean Yes/True if the cookie is secure.
Cookie.Path False string The cookie path.

* Either CookieStoreID or CookieStoreName is required.

Responses

Name Type Description
Result string Success 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?