I have the following server code.
code
var responseBody = {},
requestParams = {},
paramKeys = request.keys();
for (var key = 0; key < paramKeys.length; key++) {
requestParams[paramKeys[key]] = request.get(paramKeys[key]);
}
var vCampaign = 1122334;
var url = "https://api.sendgrid.com/v3/campaigns/{campaign_id}/schedules/now"
var XHRResponse = XHR2.send("POST", url, {
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
"parameters": {
"campaign_id:" vCampaign
},
"body":[{}]
});
Apperyio.response.success(XHRResponse.body, "application/json");
/code
When I run this I get the error: "You did not supply enough values to fill path parameters ( @ 66 : 12 ) - throw e;"
If I replace {campaign_id} in the url with a hard value, it works, but I want to pass it as a parameter. What am I doing wrong.