API – Get a File

action – readfile

An existing file in PYXI can be retrieved if its record ID is known. This would be typically from having saved this ID following an Add File call, or using the record id in a file list in e.g. a complete record read.

Assuming the file ID is valid, the file content is returned as a binary string, NOT as JSON. Only if there is an error will the response be the usual JSON format, with success false and an errormsg.

Sample Request

{ "account": *** your account id ***, "apikey": "*** your api key ***", "action": "readfile", "recordid": 8765432 }

Sample Response

Binary content of myfile.jpg

Note that the response does not provide the file name or confirm the media type of the content. It is for the API caller to first determine the file type e.g. from previous knowledge of the file content or name, and to determine the file name to be presented through any UI or download mechanism.

Get Started