A: Here is how to make a Marko endpoint call in various languages
JavaScript
var data = null; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === 4) { console.log(this.responseText); } }); xhr.open("GET", "https://www.marko.aramark.net/v1/profit_centers?search=US Bank Stadium"); xhr.setRequestHeader("content-type", "application/json"); xhr.setRequestHeader("apikey", "Insert API Key"); xhr.setRequestHeader("bypass-cache", "true"); xhr.send(data);
JavaScript (w/ jQuery AJAX)
var settings = { "async": true, "crossDomain": true, "url": "https://www.marko.aramark.net/v1/profit_centers?search=US Bank Stadium", "method": "GET", "headers": { "content-type": "application/json", "apikey": "Insert API Key", "bypass-cache": "true" } } $.ajax(settings).done(function (response) { console.log(response); });
C#
var client = new RestClient("https://www.marko.aramark.net/v1/profit_centers?search=US Bank Stadium"); var request = new RestRequest(Method.GET); request.AddHeader("bypass-cache", "true"); request.AddHeader("apikey", "Insert API Key"); request.AddHeader("content-type", "application/json"); IRestResponse response = client.Execute(request);
Python
import requests url = "https://www.marko.aramark.net/v1/profit_centers?search=US Bank Stadium" headers = { 'content-type': "application/json", 'apikey': "Insert API Key", 'bypass-cache': "true" } response = requests.request("GET", url, headers=headers) print(response.text)
cURL
curl -H "bypass-cache: true" -H "apikey: {Insert API Key}" -H "smoke: false" -X GET "https://marko.aramark.net/v1/profit_centers?search=US Bank Stadium"