Skip to content

Querying Data

Vedad Kirlić edited this page Dec 30, 2021 · 6 revisions

List User Files

We can use this endpoint to list files in a user's digi.me library

GET /v1.6/permission-access/query/<sessionKey>

Path Parameters

Parameter Required Description Type
sessionKey Yes A valid session key. string

Request Headers

Parameter Required Description Type
Accept Yes The content types, expressed as MIME types, the client is able to understand. Use application/json. string

Sample Request

curl --location --request GET 'https://api.digi.me/v1.6/permission-access/query/wKEqOoh5kb3yZJtpgdKvmMaiZXrZ6eHx' \
--header 'Accept: application/json'

Sample Response

200 OK
{
  "status": {
    "details": {
      "3_438743763": {
        "state": "completed"
      },
      "4_43232363": {
        "state": "partial",
        "error": {
          "status": <error status>,
          "statusCode": <error status code>,
          "message": <error message>,
        }
      }
    },
    "state": "completed"
  },
  "fileList": [{
      "name": "18_1_3_1_2_D200805_1.1.0.0.json",
      "objectVersion": "1.0.0",
      "updatedDate": 1604415301230
    },
    {
      "name": "18_1_3_1_2_D200710_1.1.0.0.json",
      "objectVersion": "1.0.0",
      "updatedDate": 1604415404214
    }
  ]
}

Response Definitions

Response item Description Data type
status The current sync status of the user library. LibraryDetail
fileList The current list of files in the user library. FileDetail[]

LibraryDetail

Property Description Type
state Current status of the library. LibraryStatus
details Details of each account in user library. AccountDetails

LibraryStatus

Value Description
pending Request is pending user permission.
running User permission granted. Sync is running in the library. Some files may be available and new files may be added to the library.
completed Syncs have completed. No new files will be added to the list and all files (if any) are published in files list at this point.
partial (Some of) Dependent sync(s) failed or timed out. Some files may be available. No new files will be added to the files list at this point.

AccountDetails

Property Description Type
state Current status of the library. LibraryStatus
error Optional. Details of any error with this account. Error

Error

Property Description Type
status Error status. string
statusCode Error Status Code. number
message Error Message. string

FileDetail

Property Description Type
name File Name string
objectVersion The version of the service group object. string
updatedDate Updated timestamp in milliseconds. number

Response Errors

Subject to Application, Contract, General and OAuth related errors.


Get File

We can use this endpoint to retrieve a file from user library

GET /v1.6/permission-access/query/<sessionKey>/<fileName>

Path Parameters

Parameter Required Description Type
sessionKey Yes A valid session key. string
fileName Yes A valid file name in user library. string

Request Headers

Parameter Required Description Type
Accept Yes The content types, expressed as MIME types, the client is able to understand. Use application/octet-stream. string

Sample Request

curl --location --request GET 'https://api.digi.me/v1.6/permission-access/query/wKEqOoh5kb3yZJtpgdKvmMaiZXrZ6eHx/18_1_3_1_2_D201908_1.1.0.0.json' \
--header 'Accept: application/octet-stream' \
--data-raw ''

Sample Response

  200 OK
  X-Metadata: eyJmaWxlTWV0YWRhdGEiOnsib2JqZWN0Q291bnQiOjIsIm9iamVjdFR5cGUiOiJwb3N0Iiwib2JqZWN0VmVyc2lvbiI6IjEuMC4wIiwic2VydmljZUdyb3VwIjoic29jaWFsIiwic2VydmljZU5hbWUiOiJ0d2l0dGVyIn0sInN0YXR1cyI6eyJkZXRhaWxzIjp7IjNfOTQ0NjQ0MiI6eyJzdGF0ZSI6ImNvbXBsZXRlZCJ9fSwic3RhdGUiOiJjb21wbGV0ZWQifX0

  <octet stream>

Response Header

Parameter Description Type
X-Metadata Base64 encoded JSON object describing the file contents in human readable format. string

See decryption to learn about user data decryption.

Response Errors

Subject to Application, Contract, General and OAuth related errors.

Clone this wiki locally