Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Func Dropboxapiv2_sharing_create_shared_link($path,$access_token,$short_url="false",$token_type="Bearer") ;https://api.dropboxapi.com/2/sharing/create_shared_link
- Local $apiUrl = "https://api.dropboxapi.com/2/sharing/create_shared_link"
- Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
- $oHTTP.Open("POST", $apiUrl, False)
- $oHTTP.SetRequestHeader("Authorization", $token_type & " " & $access_token)
- $oHTTP.SetRequestHeader("Content-Type", "application/json")
- $oHTTP.Send('{ "path": "'&$path&'", "short_url": '&$short_url&' }')
- Local $oReceived = $oHTTP.ResponseText
- Local $oStatusCode = $oHTTP.Status
- If $oStatusCode = 200 Then
- ConsoleWrite("$Received /sharing/create_shared_link:" & $oReceived & @CRLF)
- Return $oReceived
- Else
- ConsoleWrite("$Received /sharing/create_shared_link:" & $oReceived & @CRLF & " =>Error:" & $oStatusCode & @CRLF)
- SetError($oStatusCode)
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement