Huynhnhi92

DopboxAPI Getlink

Oct 18th, 2019
823
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Func Dropboxapiv2_sharing_create_shared_link($path,$access_token,$short_url="false",$token_type="Bearer") ;https://api.dropboxapi.com/2/sharing/create_shared_link
  2.    Local $apiUrl = "https://api.dropboxapi.com/2/sharing/create_shared_link"
  3.    Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
  4.    $oHTTP.Open("POST", $apiUrl, False)
  5.    $oHTTP.SetRequestHeader("Authorization", $token_type & " "  & $access_token)
  6.    $oHTTP.SetRequestHeader("Content-Type", "application/json")
  7.    $oHTTP.Send('{ "path": "'&$path&'", "short_url": '&$short_url&' }')
  8.    Local $oReceived = $oHTTP.ResponseText
  9.    Local $oStatusCode = $oHTTP.Status
  10.    If $oStatusCode = 200 Then
  11.       ConsoleWrite("$Received /sharing/create_shared_link:" & $oReceived & @CRLF)
  12.       Return $oReceived
  13.    Else
  14.       ConsoleWrite("$Received /sharing/create_shared_link:" & $oReceived & @CRLF & " =>Error:" & $oStatusCode & @CRLF)
  15.       SetError($oStatusCode)
  16.    EndIf
  17. EndFunc
RAW Paste Data