StediDOCS
GuidesAPI Reference
This product is in Developer Preview

Documents

Documents API

Authorization - API Key generated in Stedi terminal

List Documents

GET/documents

Returns a paginated list of document references. Download urls in the document references can be used to download the actual documents.

Parameters
Optionalquery
The page token for the requested page is returned as last_index in paginated api responses. Including the value of the last_index of a previous request as the page_token will result in the api returning the next set of results. The value must be a string.
Optionalquery
The page size for a request. If none is specified the service will return an indeterminate number of results with the resulting data payload equalling approximately 1MB of data.
Optionalquery
Controls the ordering of the documents returned by the API. By default the sort by indicator will return the results in asceding order. Optionally, to sort the documents in descending order prepend a '-' to the sort key. I.e. '-name' will return the documents ordered by name in descending order. The value must be a string.

Possible values

name id created_at -name -id -created_at

Optionalheader
The name of the internal requesting service. The value must be a string.

Example

GET
https://documentstore.prod.documents.stedi.com/v0/documents?page_token=2t7M75ZN1w4OnYFKKT0SUkT95w_ULzPR...&page_size=7748&sort_by=name

Create New Document

POST/documents

Creates a place for a new document to be uploaded to. It takes two fields, hash and name.

  • hash is the MD5 hash of the file to upload
  • name is the unique name for the file, for example example-ftp/myFiles/myfile.txt

The upload_url returned in the response is used to PUT the contents of the actual document into Documents.

Returns document metadata including the url to upload the payload to.

Parameters
Optionalquery
The page token for the requested page is returned as last_index in paginated api responses. Including the value of the last_index of a previous request as the page_token will result in the api returning the next set of results. The value must be a string. The value must be a string.
Optionalquery
The page size for a request. If none is specified the service will return an indeterminate number of results with the resulting data payload equalling approximately 1MB of data.
Optionalquery
Controls the ordering of the documents returned by the API. By default the sort by indicator will return the results in asceding order. Optionally, to sort the documents in descending order prepend a '-' to the sort key. I.e. '-name' will return the documents ordered by name in descending order. The value must be a string. The value must be a string.

Possible values

name id created_at -name -id -created_at

Optionalheader
The name of the internal requesting service. The value must be a string. The value must be a string.
Request body

application/json

Optionalstring
MD5 hash of document to be uploaded. The value must be a string.
Optionalstring
Unique name of document to be uploaded. The value must be a string.

Example

POST
https://documentstore.prod.documents.stedi.com/v0/documents?page_token=2t7M75ZN1w4OnYFKKT0SUkT95w_ULzPR...&page_size=8894&sort_by=name

Get a Document

GET/documents/{id}

Get a Document by the permanent id of document

This API does not allow a user to directly download from the api. Instead, when this endpoint is called, it returns a payload containing a download_url that can be used to download the document.

The download_url will be returned along with other metadata about the document as referenced below.

Parameters
Requiredpath
The permanent id of document The value must be a string. The value must be a string.
Optionalheader
The name of the internal requesting service. The value must be a string. The value must be a string.

Example

GET
https://documentstore.prod.documents.stedi.com/v0/documents/19db5d8f-f4ca-469e-83a9-a76a573e9692

Delete a Document

DELETE/documents/{id}

Delete a Document by the permanent id of document

Parameters
Requiredpath
The permanent id of document The value must be a string.
Optionalheader
The name of the internal requesting service. The value must be a string.

Example

DELETE
https://documentstore.prod.documents.stedi.com/v0/documents/3bd0389b-b9aa-4704-b3b6-1da345e8ea81

Get a Document

GET/documents/name/{name+}

Get a Document by the document name

This API does not allow a user to directly download from the api. Instead, when this endpoint is called, it returns a payload containing a download_url that can be used to download the document.

The download_url will be returned along with other metadata about the document as referenced below.

Parameters
Requiredpath
The name of a document The value must be a string. The value must be a string. The value must be a string.
Optionalheader
The name of the internal requesting service. The value must be a string. The value must be a string. The value must be a string.

Example

GET
https://documentstore.prod.documents.stedi.com/v0/documents/name/...

Delete a Document

DELETE/documents/name/{name+}

Delete a Document by the document name

Parameters
Requiredpath
The name of a document The value must be a string.
Optionalheader
The name of the internal requesting service. The value must be a string.

Example

DELETE
https://documentstore.prod.documents.stedi.com/v0/documents/name/...

Head a Document

HEAD/documents/name/{name+}

Head a Document by the document name This endpoint allows users to check if a document already exists.

Parameters
Requiredpath
The name of a document The value must be a string. The value must be a string.
Optionalheader
The name of the internal requesting service. The value must be a string. The value must be a string.

Example

HEAD
https://documentstore.prod.documents.stedi.com/v0/documents/name/...