Downloading content

You can download content from the GraphQL API by using the content download endpoint.

You can run a GraphQL query to retrieve the content elements of a content object such as a Document.

The ContentElement class includes a subclass ContentTransfer, which contains the downloadUrl field that can be part of the contentElements field.
contentElements {
contentType
elementSequenceNumber
... on ContentTransfer {
contentSize
retrievalName
downloadUrl
}
}
The downloadUrl field is returned in the response as a relative URL. When the downloadUrl is appended to the base GraphQL server URL, it forms a URL to the content download endpoint. For example,
https://example.server.ibm.com/content-services-graphql/content?repositoryIdentifier=OS1&documentId=...guid...&elementSequenceNumber=0