Compose a POST request using web component

Hello, can anyone help me with composing a POST request using X Thunkable (not Classic Android) Web API component?

  • I want to send 3 data values (name, email, idea) to a GoogleSheet

It would be of help also if it is done via the Google Apps Script, that one can create from within the GoogleSheet. Most of my attempts have failed, and all I get is Undefined.

A complete sample aia would be great.

thanks

1 Like

It’s very Simple !!
Create a Custom Html form for this and Upload the required details ( name , email and idea ) through it to the Spreadsheet.

Do you want the AIA or blocks Screen shorts for this ??

Yes Please!

yes, that would be great if you can provide the blocks screen shots.
Much appreciated in advance.
thanks

Please can you share a sample project for this. it would be greatly appreciated

Hi @Nenye

Of what ? If you are talking about to send 3 data values (name, email, id) to a GoogleSheet in thunkable x then here i have a solution for you !!


First you have to create a google app script Url !!
Here is how you can create one. . .

http://community.thunkable.com/t/send-upload-data-to-google-sheets-using-script/68466?u=cttricks

Note that the Step 3 for thunkable x is going to be different !! So after creating your script url you have to follow these steps ;


Step 3 : Blocks Section
Here we don’t have a web component in thunkable X so we are using Web Viewer to post/ send data.
Make sure in the properties section of the web viewer component !! Visibility is set to False.

Design Part ||

Blocks Part ||


:link: Get Demo AIA

// Ct tricks

2 Likes

If you have any query !! feel free to ask :grinning:

Also Read this post

1 Like

Thanks!

hi my friend, can you help me whit this? Help with POST and PHP

thanks a lot

1 Like

how would one deal with basic HTTPS Authentication? don’t think i’ve seen this yet in the forums
wiki/Basic_access_Auth

the provided sample is code is:

curl https://api.site.com/store
-u usrkey:
-d “description=brown-fox”

am trying https://usrkey:pass@api.site.com/
but the response is “missing authentication” status code 401. is there another way to pass the credentials?

this looks better
{
“url”: “https://api.site.com/store”,
“raw_url”: “https://api.site.com/store”,
“method”: “get”,
“auth”: {
“user”: “usrkey”,
“password”: “pse”
}
}

you could try to put “auth”: {
“user”: “usrkey”,
“password”: “pse”
}
into the body of your api get/post

does the api provide documentation?

How to pass Auth HTTP POST Request

@jared you gave me an idea

so i did some tests in 3 different apis i found online and this is what worked for me (my blocks should be self explanatory).

Notes:
don’t mind the naming conventions I was prototyping and too lazy to keep changing names.
Authorization for most apis i came accross was always Basic and you will need to convert your user:passwd to base64 encoding. some apis use apikey:(password is blank) refer to api docs
example lets say your your username:admin and password:passowrd1. go to a base64 encoder enter admin:password1 of and encode it. so for this case the block Authorization would look as such
Authorization “Basic YWRtaW46cGFzc3dvcmQx”

sources:
HTTP Header
base64encoder

2 Likes