How To
Summary
This document covers the steps to download attachments based on doctypes
Steps
1.) Create an object structure - MXAPIDOCLINKS (or give any name you prefer) with a single object - DOCLINKS.
2.) Authorize access to the new object structure. If you are unsure how to do this, check How to configure Object Structure Security
3.) Run the query by using postman for example:
GET /api/os/mxapidoclinks?oslc.where=doctype="Attachments"&oslc.select=document,documentdata&inlinedoc=1&oslc.pageSize=100
![image-20230424141122-1](/support/pages/system/files/inline-images/image-20230424141122-1.png)
The response contains base64 encoded attachments as part of the "documentdata" property - with a filter of doctype = Attachment.
inlinedoc=1 is critical for this query, otherwise documentdata will not be populated.
This query is just an example. You can use oslc.where to filter the right doctype.
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB59","label":"Sustainability Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSRHPA","label":"IBM Maximo Application Suite"},"ARM Category":[{"code":"a8m0z000000GpMWAA0","label":"Integration-\u003ERest API"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]
Was this topic helpful?
Document Information
Modified date:
24 April 2023
UID
ibm16985501