Page 1 of 1

You did not supply enough values to fill path parameters ( @ 66 : 12 ) -> throw e;

Posted: Sat Feb 06, 2016 1:45 am
by Louis Adekoya

I have the following server code.

code
var responseBody = {},
requestParams = {},
paramKeys = request.keys();
for (var key = 0; key < paramKeys&#46;length; key++) {
requestParams[paramKeys[key]] = request&#46;get(paramKeys[key]);
}

var vCampaign = 1122334;
var url = "https:&#47;&#47;api&#46;sendgrid&#46;com/v3/campaigns/{campaign_id}/schedules/now&quot

var XHRResponse = XHR2&#46;send("POST", url, {
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
"parameters": {
"campaign_id:" vCampaign
},
"body":[{}]
});

Apperyio&#46;response&#46;success(XHRResponse&#46;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.


You did not supply enough values to fill path parameters ( @ 66 : 12 ) -> throw e;

Posted: Sat Feb 06, 2016 6:03 pm
by Serhii Kulibaba

Hello,

Appery.io Server code doesn't parse request URL with request parameters.

So please use URL of the service:
pre"https:&#47;&#47;api&#46;sendgrid&#46;com/v3/campaigns/"+requestParams['campaign_id'] + "/schedules/now";/pre

instead of:
pre"https:&#47;&#47;api&#46;sendgrid&#46;com/v3/campaigns/{campaign_id}/schedules/now";/pre


You did not supply enough values to fill path parameters ( @ 66 : 12 ) -> throw e;

Posted: Sat Feb 06, 2016 8:40 pm
by Louis Adekoya

Perfect Sergiy! It's easy when you know how :-) Many thanks.