Code: Alles auswählen
AuthIdentify(OAuth2Params)
Im Prinzip dem Beispiel entnommen:
Code: Alles auswählen
req is httpRequest
req.Method = httpPost
req.URL = "https://api.dropboxapi.com/2/files/list_folder"
req.AuthToken = MyToken //
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)
Das sollte so ähnlich funktionieren (ACHTUNG geht so nicht):
Code: Alles auswählen
req.Method = httpPost
req.URL = "https://api.dropboxapi.com/2/files/copy_v2"
req.AuthToken = MyToken
req.ContentType = "application/json" // Wahrscheinlich schon falsch
vParaAPI is Variant
// --- Folgendes wird falsch sein:
// ---
vParaAPI.rsource = [
{"from_path":"c:\\temp\\ep_setup.exe","to_path":""}
]
req.Content = VariantToJSON(vParaAPI)
httpMyResponse is httpResponse = HTTPSend(req)
IF httpMyResponse.StatusCode= 200 THEN
let JsonRespons = JSONToVariant(httpMyResponse.Content)
Trace(JsonRespons)
ELSE
END