Initiate File Upload to Internal Store

POST /files/uploads

Authorization Header

  • Bearer token: OAuth 2.0 API access token. 

Parameters

  • format: json or xml. This will override the Request Accept header.
  • human: true or false. Causes the response to be in a structured, more human-readable form. Useful when calling the API through curl or a browser.
  • object_key: Object key which later references the uploaded file (e.g. in Job submissions).
  • pipeline_id: The id of a pipeline. The uploaded object will be created as a object key relative to the respective pipeline's root path.
  • ip: IP address of the uploader as an integer (e.g. obtainable via the ip2long() PHP function). Optional. If specified, the form post URL returned to be used with the upload will be geo-optimized to be closer to the given IP's geo-location.
  • expires_at: Epoch timestamp that indicates when to auto-delete the uploaded object from storage again if it hasn't been used with a Job meanwhile. If not set, the default expiry time is 7 days. If you want your uploaded objects to persist indefinitely (even when not used in a Job), set the expires_at parameter to a value of 0 (= never expire).


Response:

Returns an upload "session" consisting of the action url to which to make a multipart form-post with the file data to be uploaded as well as a set of form post parameters that must be included as part of the request.

POST /files/uploads
curl -X POST -H "Authorization: Bearer um9VmyJKTPGFqpkL_THjGE5rkXqfURDYqQ8MTBVidG3PtwkfABIdx6s_z9WlFl4_j" "https://api.xvid.com/v1/files/uploads/?object_key=uploads%2Ftest.mp4&pipeline_id=53a1ac4914eaa8ffa4fce91b"

{
	"upload": {
		"form_post_params": {
            "name": "test.mp4",
            "success_action_status": "201",
            "filename": "",
            "chunk": "0",
            "chunks": "1",
			"policy": "eyJleHBpcmF0aW9uIjoiMjAxNC0wNi0yMFQwOTo0NjowNi4yNzlaIiwiY29uZGl0aW9ucyI6W3siYnVja2V0IjoieHZpZC1tZWRpYWNvZGVyIn0sWyJzdGFydHMtd2l0aCIsIiRuYW1lIiwiIl0sWyJzdGFydHMtd2l0aCIsIiRrZXkiLCI1M2ExYWM0OTE0ZWFhOGZmYTRmY2U5MWIvIl0sWyJzdGFydHMtd2l0aCIsIiRmaWxlbmFtZSIsIiJdLHsiYWNsIjoicHJpdmF0ZSJ9XX0=",
			"signature": "y7eAlMzKsVyNHkKEfN1/DnVTh34=",
			"AWSAccessKeyId": "AKIAINU6WW5PT7GRJLVA",
			"key": "tmp/53a1ac4914eaa8ffa4fce91b/uploads/test.mp4",
			"acl": "private"
		},
        "status": "UPLOADING",
        "object_key": "uploads/test.mp4",
        "nb_chunks": 0,
		"type": "S3",
		"form_post_url": "https://s3-eu-west-1.amazonaws.com/prd-xmc-xvid-s3-eu-west-1/",
        "pipeline": {"id": "53a1ac4914eaa8ffa4fce91b"},
        "file" : {"id": "53a1ac4914eaa8ffa4fce38c"},
        "id": "53a1ac4914eaa8ffa4fce38c"
	}
}



  • No labels