CookieStore.AddCookies
April 30, 2019
Description
Adds one or more cookies to an existing cookie store from valid JSON POST data
Required parameters
CookieStoreID or CookieStoreName, POST Data (JSON)
Required POST Data
Must be valid JSON. Each JSON object must have: Name, Domain
Optional POST Data
Value, Expires, HttpOnly, Secure, Path
Returns
The result of the operation including the CookieStoreID and the number of new cookies that were added to the cookie store
Example request url
https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=CookieStore.AddCookies&CookieStoreName=Lowes%20Cart
Example POST request
var xhr = new XMLHttpRequest(); xhr.open("POST", 'https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=CookieStore.AddCookies&CookieStoreName=Lowes%20Cart', true); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.send(JSON.stringify([ { 'Name': 'First cookie from JSON', 'Domain': 'lowes1.mozenda.com', 'Value': 'First cookie value' }, { 'Name': 'Second cookie from JSON', 'Domain': 'lowes2.mozenda.com', 'Value': 'Second cookie value' } ]));
Example response
<CookieStoreAddCookiesResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Result>Success</Result> <CookieStoreID>1006</CookieStoreID> <NewCookieCount>2</NewCookieCount> </CookieStoreAddCookiesResponse>