Contact Form - Sendgrid - Working tutorial

Hello,

There is no tutorial that works with supporting documentation for the most simple custom API, a contact form using send grid. I am trying to cobble something together but get Request failed with status code 401.

I am seeing the problem of there being no tutorial in all comments and past forum posts. Please we need a working detailed tutorial.

Where to get JSON code from. Where a good tutorial for sendgrid using Adalo?

Kind regards, Matthew.

1 Like



Hi @GOZA ,
Did you add the “Bearer” before your key in the authorization?

Also in the header, you can add “Content-Type” with value “application/json”. Some APIs are very particular about this.

image

I sanitized my text before adding to the custom action.

image

Also check if your “from” email is validated to send emails.

2 Likes

I’m trying this, but the custom action window crashes/closes so often it is making this very stressful. Thank you for help, one time got pass 401 error to 400 error, then Adalo crashed the window again.

How do you mean sanatized the text?

I just copied all texts from SendGrid documentation to notepad before pasting into Adalo.

1 Like

Got it working, I think if I type Bearer before ctrl+v pasting the api key it doesnt work, need to paste key, then write bearer after (or sanatize as you say) to get it to acknowledge input!

Yeah, I switched to Token magic text because of that and sanitized before copy/paste. Super, glad you got it working.

1 Like

Okay I have been quite busy, but now back to continueing with this send grid, the custom API gets tested, sends me an email and saves, I put the text input boxes in to the custom API inputs using the magic tool. Load it up in preview, and guess what, you press send, the circle thing whirls for a second and then no email sends.

Open the custom API, test it again, sends email successfully… whats going on? :face_with_peeking_eye:

Hi @GOZA ,
Would need to check your app, check for spaces in the email field, or build the input text box again for the email.

You could also create button again. sometimes I have issue that pressing once it does not work, could be app was down temporarily.

Also you left an extra element in the screen, not that it effects, just showing in case you missed it :slight_smile: :

1 Like

Check there are no line breaks in any of the text you are sending to the api. Line breaks will break it… no error code, it acts as if the call was successful.

1 Like

You could also create button again. sometimes I have issue that pressing once it does not work, could be app was down temporarily.

This seemed to get the link to modal to work, but not the custom API. It does the spinny wheel animation first, like its trying to create the API call.

(well spotted, thanks for the red circle, not sure when I pasted that text there, funny)

Check there are no line breaks in any of the text you are sending to the api. Line breaks will break it… no error code, it acts as if the call was successful.

Not that I’m aware of, my input boxes are single lines. How do you create a line break then, as currently my email through send grid is a long line of text. Using dynamic templates on sendgrid site perhaps?

Current JSON body:

Okay you are actually a legend. Thank you so much for your help - it was the e-mail input, I changed it from text to e-mail type input, made sure any spaces were removed before the magic link. And wallaaa. It works.

Fantastic thank you. :sweat_smile:

1 Like