PDS Asset Endpoints
Introduction
Mydex provides a personal data store that can capture and organise structured and unstructured data of both a meta and transactional nature. It is not designed to be a general purpose document or file store but there are a range of scenarios where objects of specific types and their associated data may need to be stored, (e.g. a scanned document or image file, a PDF or other document format), in the context of a specific transaction or as part of an application or service that is using the PDS as the personal data repository.
This following is the draft documentation for the assets features of the PDS and API services within the Mydex platform. The capability is live in production and sandbox environments but we have not added this capability into the general purpose developer connections on the sandbox in preference for making it available to those Subscribing organisations who are working towards a live connection where we will set up a dedicated connection on the sandbox to support their project and connection objectives.
The rationale for this is in part to manage resource utilisation on the sandbox and also to prevent inappropriate use of the sandbox by unknown actors.
Asset Documentation
Parameters required for all of the endpoints listed below:
The PDS Create API requires the following items of member data:
uidkeycon_idapi_key
Examples given as https://sbx-api.mydex.org. For use on production environment replace with https://api.mydex.org.
GET /api/assets/list
Shows a list of all assets in the member's PDS.
Optional parameters for filtering:
datasetverified
Example
https://https://sbx-api.mydex.org/api/assets/list?uid={{uid}}&con_id={{con_id}}&key={{key}}&api_key={{api_key}}&source_type=connection
Returns:
{"passport":{"image":["2709.passport-1.pds","2709.passport-2.pds"],"pdf":["2709.passport-1.pds"]}}
GET /api/assets/retrieve
Retrieve a specific asset. File is returned as base64 encoded string.
Additional required parameters:
datasetversiontype
Example
https://sbx-api.mydex.org/api/assets/retrieve?uid={{uid}}&key={{key}}&con_id={{con_id}}&api_key={{api_key}}&dataset=passport&version=2&type=image
Returns:
{"image":"\/9j\/4AAQSkZJRgA....","note":"","verified":"0","additional_data":""}
POST /api/assets/upload
Upload an image or pdf to a member's PDS e.g. from a form.
Additional required parameters:
dataset(currently must bepassportordriving_licence)
Required post data:
photo_uploadfile sent to be used by PHP's$_FILESvariable
Optional post data:
user_note(short string for description etc)additional_data(json data if you'd like to store any additional data with the asset)
Example
https://sbx-api.mydex.org/api/assets/upload?uid={{uid}}&key={{key}}&con_id={{con_id}}&api_key={{api_key}}&dataset=passport
Returns:
{"success":"1"}
POST /api/assets/add
Post a new asset to a member's PDS.
Additional required parameters:
dataset(currently must bepassportordriving_licence)
Required post data:
encoded_imagea base64 encoded string of the file
Optional post data:
user_note(short string for description etc)additional_data(json data if you'd like to store any additional data with the asset)
Example
https://sbx-api.mydex.org/api/assets/upload?uid={{uid}}&key={{key}}&con_id={{con_id}}&api_key={{api_key}}&dataset=passport
Returns:
{"success":"1","dataset":"passport","version":"2","type":"pdf"}
DELETE /api/assets/delete
Deletes a specific assets entry.
Additional required parameters:
datasetversiontype
Example
https://sbx-api.mydex.org/api/assets/delete?uid={{uid}}&key={{key}}&con_id={{con_id}}&api_key={{api_key}}&dataset=passport&version=1&type=image
Returns:
{"success":"1"}