Uploads a file to a specific upload URL.
where $upload_url
is the URL displayed in the links.upload
field in the response body of a successful Authorize request.
See Authorize for details.
Header Field | Value |
---|---|
filename |
Required. File name of the uploaded file. |
Binary. Attached source file.
curl -X POST --data-binary @example.doc -H "filename: example.doc" $upload_url
import requests, json
filename = "example.doc"
content = open(your_file,"rb").read()
r = requests.post(auth_response["links"]["upload"], content, headers={"filename": your_file})
upload_response = json.loads(r.text)
The response is at minimum an empty JSON array.
Name | Type | Description |
---|---|---|
error | string | The default error message is invalid_request when the link is expired or the request is broken. |
HTTP 202, OK
{}
HTTP 400, Bad Request
{
"error": "invalid_request"
}
Code | Value | Description | Response Body Value |
---|---|---|---|
202 | Accepted | Upload file accepted. | {} |
400 | Bad Request | The file was not sent with the request. | invalid_request |