1

I want to print share's Link from a file using API dropbox = python
My code:

import requests
import json

url = "https://api.dropboxapi.com/2/sharing/create_shared_link"

headers = {
    "Authorization": "Bearer ACCESS_TOKEN_REDACTED",
    "Content-Type": "application/json"
}

data = {
    "path": "/132005.jpg"
}

r = requests.post(url, headers=headers, data=json.dumps(data))

Now i want to get url to share like:

https://www.dropbox.com/s/o3hniburr4byytu/132005.jpg?dl=0

What print??? Thank bro

Greg
  • 16,359
  • 2
  • 34
  • 44
  • Possible duplicate of https://stackoverflow.com/questions/6998943/python-requests-module-json-responses – dmitryro Nov 04 '17 at 04:19
  • I redacted your access token, but since you posted it publicly, you should revoke it. By the way, for the sake of security, you should disable that access token. You can do so by revoking access to the app entirely, if the access token is for your account, here: https://www.dropbox.com/account/security Or, you can disable just this access token using the API: https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke – Greg Nov 04 '17 at 13:29

1 Answers1

1

Possible options you can check or try out.

print r.json()
print r.content
print r.text
print r.status_code
Mahesh Karia
  • 2,045
  • 1
  • 12
  • 23