Menu

how to upload multiple Attachment through API

Rahul Babu
2024-05-15
2024-05-16
  • Rahul Babu

    Rahul Babu - 2024-05-15

    how to upload multiple Attachment through API

     
  • Rahul Babu

    Rahul Babu - 2024-05-15

    Hi @jeffrey
    this is my json format plz check it

    {
    "operation": "core/create",
    "comment": "Upload file",
    "class": "Attachment",
    "fields": {
    "item_id": 70,
    "item_class": "WOrder",
    "contents":{
    "contents_data":{
    "data": "base64convertedfile",
    "mimetype": "text/rtf",
    "filename": "filename.rtf"
    },
    "contents_data":{
    "data": "base64convertedfile",
    "filename": "filename1.docx",
    "mimetype": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
    }
    }
    }
    }

     

    Last edit: Rahul Babu 2024-05-16
    • Jeffrey Bostoen

      Jeffrey Bostoen - 2024-05-15

      I believe your structure is wrong.

      Try

      {
      "operation": "core/create",
      "comment": "Upload file",
      "class": "Attachment",
      "fields": {
      "item_id": 70,
      "item_class": "WorkOrder",
      "contents":{
       "data":{ ...},
       "filename": "xxx",
       "mimetype": "xxx"
       }
       }
      
       
      • Rahul Babu

        Rahul Babu - 2024-05-16

        This is also not working

         
  • Rahul Babu

    Rahul Babu - 2024-05-15

    when hit the API in postman then this error comes-
    {
    "code": 100,
    "message": "Error: Unexpected value for attribute 'contents': Null not allowed: issues = {0=>Unexpected value for attribute 'contents': Null not allowed}, class = Attachment, id = "
    }

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.