Page 1 of 1

Passing parameters to sendgrid

Posted: Wed Oct 21, 2015 9:39 am
by JimmyH

Hi there,

I have setup (using the tutorial) the standard Sendgrid api and it works fine when I enter values directly into the service using the request tab. I have it setup with secure proxy.

I am however having problems sending when I use service execute command.

Can you please advise where I am going wrong:

Test.execute({"data": {"api_user": "{api_user_proxy}", "api_key": "{api_key_proxy}","to":"a href="mailto:Name1@gmail.com" rel="nofollow"Name1@gmail.com/a","from":"a href="mailto:Name2@gmail.com" rel="nofollow"Name2@gmail.com/a","subject":"Test email"}});

where SendGrid is the name of my service

It appears to be failing on the POST (400 bad request). I get the following error:

errors: ["Missing destination email"], message: "error"}
errors: ["Missing destination email"]
message: "error"

your help would be much appreciated.

THanks
James

the request payload looks like this
api_user=%7Bapi_user_proxy%7D&api_key=%7Bapi_key_proxy%7D&to=james.holman00%40gmail.com&from=james.holman00%40gmail.com&subject=Test+email


Passing parameters to sendgrid

Posted: Wed Oct 21, 2015 4:27 pm
by Serhii Kulibaba

Hello Jimmy,

You send {api_user_proxy} as a string. Please change it into current value. Service Settings don't apply when you execute service from the JS


Passing parameters to sendgrid

Posted: Wed Oct 21, 2015 7:53 pm
by JimmyH

Hi Sergiy,

I have changed both the api_user_proxy and the api_key to strings (ie the Sendgrid username and api key) and it still does not work and I still get the same error ie POST (400 bad request). I get the following error:

errors: ["Missing destination email"], message: "error"}
errors: ["Missing destination email"]
message: "error"

If you enter both the api_user_proxy and the api_key as strings, doesn't it mean that these values will be visible in the javascript which is not secure?.

thanks
james


Passing parameters to sendgrid

Posted: Wed Oct 21, 2015 8:05 pm
by JimmyH

this is what my script looks like:

Test.execute({"data": {"api_user": "UserName", "api_key": "APIKEY","to":"a href="mailto:somebody@gmail.com" rel="nofollow"somebody@gmail.com/a","from":"a href="mailto:somebody@gmail.com" rel="nofollow"somebody@gmail.com/a","subject":"Test email"}});

where UserName and APIKEY is the string from SendGrid details.


Passing parameters to sendgrid

Posted: Thu Oct 22, 2015 8:29 pm
by Serhii Kulibaba

Please share (http://devcenter.appery.io/documentat...) your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and provide us with the following information:

1) App name
2) Test credentials if login functionality is implemented in your app
3) Detailed steps to reproduce the issue