{"id":3339,"date":"2021-08-24T09:26:49","date_gmt":"2021-08-24T07:26:49","guid":{"rendered":"https:\/\/www.trans.eu\/api\/?p=3339"},"modified":"2025-12-29T10:55:30","modified_gmt":"2025-12-29T09:55:30","slug":"uploading-and-downloading-attachments","status":"publish","type":"post","link":"https:\/\/www.trans.eu\/api\/attachments\/uploading-and-downloading-attachments\/","title":{"rendered":"Uploading and downloading attachments"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Authorization and access<\/h2>\n\n\n\n<p>Autho\u00adriza\u00adtion process is described <a href=\"https:\/\/www.trans.eu\/api\/general-information\/authorization-process\/\" target=\"_blank\" rel=\"noopener\" title>here<\/a>. Each API request must also con\u00adsist of unique Api-key obtained dur\u00ading appli\u00adca\u00adtion reg\u00adis\u00adtra\u00adtion togeth\u00ader with client_id and client_secret.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Headers<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Accept: mul\u00adti\u00adpart\/\u00adform-data<\/li>\n\n\n\n<li>Con\u00adtent-type: mul\u00adti\u00adpart\/\u00adform-data<\/li>\n\n\n\n<li>Autho\u00adriza\u00adtion: Bear\u00ader {access_token}<\/li>\n\n\n\n<li>Api-key: {unique_ap\u00adp_api-key}<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Available file types<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>JPG, GIF, PNG, BMP, PDF, ODT, DOC, TXT, DOCX, TIFF, ODS, XLS, XLSX, PPT, RTF<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Uploading file url parameters<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>URL: <\/strong>https:\/\/api.platform.trans.eu<\/li>\n\n\n\n<li><strong>End\u00adpoint:<\/strong>&nbsp;<span class=\"_3oh- _58nk\">\/ex\u00adt\/\u00adme\u00addia-stor\u00adage-api\/v1\/as\u00adsets<\/span><\/li>\n\n\n\n<li><strong>Http Method:<\/strong> PUT<\/li>\n<\/ul>\n\n\n\n<p>File should be send in request body (request body should be send as form data).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Json response example<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>{\n  \"id\": \"eb6bd829-0794-4553-8d8f-7f000ea76d15\",\n  \"path\": \"https:\/\/service.media-storage.query\/v1\/assets\/eb6bd829-0794-4553-8d8f-7f000ea76d15\",\n  \"ttl\": {},\n  \"file\": {},\n  \"image\": {}\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Downloading file from an order url parameters<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>URL: <\/strong>https:\/\/api.platform.trans.eu<\/li>\n\n\n\n<li><strong>End\u00adpoint:<\/strong> \/ext\/media-storage-api\/v1\/assets\/{mediaId}<\/li>\n\n\n\n<li><strong>Http Method:<\/strong> GET<\/li>\n<\/ul>\n\n\n\n<p><span style=\"font-weight: 400;\">You will get file in response.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"dont-break-out\">Autho\u00adriza\u00adtion and access Autho\u00adriza\u00adtion process is described here. Each API request must also con\u00adsist of unique Api-key obtained dur\u00ading appli\u00adca\u00adtion \u2026<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"wp_typography_post_enhancements_disabled":false,"footnotes":""},"categories":[70],"tags":[],"class_list":["post-3339","post","type-post","status-publish","format-standard","hentry","category-attachments"],"acf":[],"aioseo_notices":[],"lang":"en","translations":{"en":3339},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/3339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/comments?post=3339"}],"version-history":[{"count":1,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/3339\/revisions"}],"predecessor-version":[{"id":5503,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/posts\/3339\/revisions\/5503"}],"wp:attachment":[{"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/media?parent=3339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/categories?post=3339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trans.eu\/api\/wp-json\/wp\/v2\/tags?post=3339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}