Version 1.9.72 (Release Notes)


copyhttps://api.pixlab.io/copy

Description

Copy a media from a remote location and store it on the pixlab.xyz storage server. If you have already set your own AWS S3 keys (refer to your dashboard on how to do that), then the media shall be copied to your S3 bucket.

HTTP Methods

GET

Request Parameters

Required

FieldsTypeDescription
linkURLInput media URL or Unique ID.
keyStringYour PixLab API Key. You can also embed your key in the WWW-Authenticate: HTTP header and omit this parameter if you want to.

Response

application/json.

This command always return a JSON object after each call. The following are the JSON fields returned in response body:

FieldsTypeDescription
statusIntegerStatus code 200 indicates success, any other code indicates failure.
linkURLLink to the media output which is usually stored on the pixlab.xyz storage server unless you set your own S3 keys (refer to your dashboard on how to do that).
idStringUnique media ID.
errorStringError message if status != 200.

Python Example

import requests
import json
#Copy the following image to our bucket 
req = requests.get('https://api.pixlab.io/copy',params={'img':'http://cf.broadsheet.ie/wp-content/uploads/2015/03/jeremy-clarkson_3090507b.jpg','key':'My_Pix_Key'})
reply = req.json()
if reply['status'] != 200:
	print (reply['error'])
else:
	print ("Copied image: "+ reply['link'])

See Also