Hello everyone!! I want to make an app of this website. (I have the permission of the owner and the exclusivity )
But I need help to use this API (Gofile - Free file sharing and storage platform)
Itās on curl but I want to know how to use it on my app.
Thanks!!
the api looks easy.Which is the request you want to implement in your app?
All that are in the web. I need only an example of one type to understand the api
You can try use PHP CURL.
How is it? Any extension?
You can as example try Upload file for example
Set request headers to make list- make list - item 1 : Content-Type item2 = multipart/form-data
Set url to https://{server}.gofile.io/uploadFile
Create a post request to build request data from a list that consists from 1 another list with two items.Item 1 = file item 2 = your file ( example from the website = @file.txt )
If i said some thing wrong you can correct me.
You will get response like that:
You will need to parse it to dictionaries using my extension here
And then you can use get block in the dictionaries to get any of the keys the json have like the token for example.An example of a response:
{āstatusā:āokā,ādataā:{ācodeā:ā123Abcā,āadminCodeā:ā3ZcBq12nTgb4cbSwJVYYā,āfileNameā:āfile.txtā}}
No. It is PHP Scripts with CURL Library or another language.
Web Component.
Can you show me an example in blocks please? I donāt have a lot of experience on HTTP post and request @Mohamed_Tamer
How can execute the curl commands on my app? @Rogerio_Rios
With web component + PHP with CURL Library commands.
Look this API example in PHP CURL, This is an example of another API. You will have to adapt it ā¦
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.openrouteservice.org/v2/directions/driving-car");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"coordinates":[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]]}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8",
"Authorization: your-api-key",
"Content-Type: application/json; charset=utf-8"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
?>
Hereās an example:
I get the error:
Error 1103
Unable to put the text file=logo.png with the specific URLā¦
That isnāt a file.A file is something like that : @file.txt. Can you show me your blocks?
BTW, have you replaced the server word here:
With you sever.
Please show me you blocks
Yes. I have replaced the server name. I havenāt put the @ before the asset name
You canāt upload assets as i think but iām not sure Also can you show you blocks?
Still isnāt working?BTW, the @ part is very important.And still.you canāt read files from assets.Try with files from storage.
You just need the file name and not the full path.Something like
@file.png
What users need to learn and to understand how an API and the APIs they want to consume work, not the ready blocks.