PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Dropbox API V2: howt o send a file
Dropbox API V2: howt o send a file
Débuté par Markus, 13 jan. 2023 11:35 - 1 réponse
Membre enregistré
9 messages
Posté le 13 janvier 2023 - 11:35
Hi, has everyone a sample or code snipped how to send a file via Windev to dropbox?

I can list a folder with this code:

OAuth2Params is OAuth2Parameters
OAuth2Params.ClientID = "01234567890123456789" // sample!!!
OAuth2Params.ClientSecret = "98765432109876543210"
OAuth2Params.AuthURL = "https://www.dropbox.com/oauth2/authorize"
OAuth2Params.TokenURL = "https://api.dropboxapi.com/oauth2/token"
OAuth2Params.AdditionalParameters = "force_reapprove=false"
<COMPILE IF TypeConfiguration<>Site>
OAuth2Params.RedirectionURL = "http://localhost:9874/"
<END>

//
MyToken is AuthToken = AuthIdentify(OAuth2Params)

req is httpRequest
req.Method = httpPost
req.URL = "https://api.dropboxapi.com/2/files/list_folder"
req.AuthToken = MonToken // Token d'authentification
req.ContentType = "application/json"
vParamAPI is Variant
vParamAPI.path = "" // = Root
vParamAPI.recursive = False
vParamAPI.include_media_info= False
vParamAPI.include_deleted = False
vParamAPI.include_has_explicit_shared_members = False
req.Content = VariantToJSON(vParamAPI)

reponseHTTP is httpResponse = HTTPSend(req)
let resonseJson = JSONToVariant(reponseHTTP.Content)



How can I send a file to dropbox (pdf or zip files)?

--
br
markus
Posté le 10 juillet 2023 - 22:46
bonjour a tous
je cherche aussi..
J'y arrive presque mais le fichier est partiellement tronqué une fois uploadé.