TIMAI2
December 20, 2021, 10:14am
10
curl -d "client_id=<client_id>&scope=https://www.googleapis.com/auth/drive.file" https://oauth2.googleapis.com/device/code
the end of the scope url is missing
curl -d client_id=<client id> -d client_secret=<client secret> -d device_code=<device code> -d grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code https://accounts.google.com/o/oauth2/token
>
not set, and the url is wrong/missing
curl -X POST -L \
-H "Authorization: Bearer <enter access token here>" \
-F "metadata={name :'<our.zip>'};type=application/json;charset=UTF-8" \
-F "file=@<our.zip>;type=application/zip" \
"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart"
most of the metadata
value is missing
2 Likes
First one is good , the scope url ends here
TIMAI2:
drive.file"
In Second one , you need to change the below values with real values , the <> makes it difficult to parse the curl
TIMAI2:
<client id>
TIMAI2:
<client secret>
Third one I will look detailly.
Thank you for checking
TIMAI2
December 20, 2021, 10:48am
12
Jerin_Jacob:
In Second one
I found if I put the key:pair items after each -d
in quotes then it works...
curl -d "client_id=<client id>" -d "client_secret=<client secret>" -d "device_code=<device code>" -d "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code" https://accounts.google.com/o/oauth2/token
2 Likes
curl is a command to execute a api in one statement this curl to blocks by jerin converts a curl command to ai2 blocks so that we know how do we do it in ai2 using curl.
2 Likes
Horizon
December 20, 2021, 11:55am
14
Thanx @Aarush_Kumar Now i got it
1 Like
@Jerin_Jacob great tool , amazed to find -u
working in your tool
TIMAI2
December 22, 2021, 5:03pm
18
@Jerin_Jacob
For the three cURL stanzas I provided, when in App Inventor, I found that the dictionaries did not work, the blocks had to be written out like this (nothing like the ones provided by the tool):
curl -d "client_id=<client_id>&scope=https://www.googleapis.com/auth/drive.file" https://oauth2.googleapis.com/device/code
curl -d client_id=<client id> -d client_secret=<client secret> -d device_code=<device code> -d grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code https://accounts.google.com/o/oauth2/token
curl -X POST -L \
-H "Authorization: Bearer <enter access token here>" \
-F "metadata={name :'<our.zip>'};type=application/json;charset=UTF-8" \
-F "file=@<our.zip>;type=application/zip" \
"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart"
I guess it all depends on what you are cURLing
It is certainly a useful tool to get started on the conversion.
5 Likes
very nice, to do a "curl" can not be used? (I've never been able to)
unfortunately the curl is installed in very few android, you probably all used virtualizers,i turned the web in all directions and couldn't figure out how to fix this. curl only works if it is installed on the device
Awesome @Jerin_Jacob !
I loved your work
1 Like
not working for me i have a curl which run fine in online website which convert curl in response content but when i try this method i didnt get response
please help me
without knowing your curl statement, no body can help you.
TIMAI2
December 19, 2022, 9:17am
26
All the key pairs with an -H, need to go in the responseHeaders list as lists of pairs, the rest in a normal GET URL.
Can you please show me blocks. How to arrange it
this is the last step of my app please help me