JSON Rest API - Replace URL

Replace URL

Replaces image for specific asset, keeping ID intact

Request (POST)

URL

/assets/mediadb/services/module/asset/attachments/uploadprimary

Parameters

assetid: the asset's ID

Sample Request

create file with json:
cat source.json 
{ 
    "assetid": "AXLIZAeT6Khr_XFrhdhk" 
}

curl -H "Content-Type: multipart/form-data" \
    --request POST http://entermedia.org/assets/mediadb/services/module/asset/attachments/uploadprimary \
    -b 'entermedia.keyassets=adminmdxxxx; JSESSIONID=xxx' \
    --form "upload1=<source.json;type=application" \
    --form="upload2=@sample.jpg;type=multipart/form-data" 

 

Response

Sample Response

{
  "sessionid": "attachmentcountattachmentassets/catalog",
  "page": "1",
  "pages": "1",
  "totalsize": "4",
  "primaryfile": "test.jpg",
  "attachments": [
    {
      "id": "AXLIcQqb6Khr_XFrhdh1",
      "name": "source.gif",
      "sourcepath": "Clients/TK2/TK2024342/2020-6",
      "folder": "",
      "parentsourcepath": "Clients/TK2/TK2024342/2020-6"
    },
    {
      "id": "AXLIvrrs6Khr_XFrhdik",
      "name": "test.jpg",
      "sourcepath": "Clients/TK2/TK2024342/2020-6",
      "folder": "",
      "parentsourcepath": "Clients/TK2/TK2024342/2020-6"
    },
    {
      "id": "AXLIcQlw6Khr_XFrhdh0",
      "name": "image1024x768.jpg",
      "sourcepath": "Clients/TK2/TK2024342/2020-6",
      "folder": "",
      "parentsourcepath": "Clients/TK2/TK2024342/2020-6"
    },
    {
      "id": "AXLIvroL6Khr_XFrhdij",
      "name": "ilu.ai",
      "sourcepath": "Clients/TK2/TK2024342/2020-6",
      "folder": "",
      "parentsourcepath": "Clients/TK2/TK2024342/2020-6"
    }
  ]
}