AnsweredAssumed Answered

How to use Samanage Api Attachment with a real json format.

Question asked by samanage_api_test@dpr.com on Apr 12, 2017
Latest reply on May 12, 2017 by Ramon Geertjens

Hi

 

I'm using Httpclient .net library to make the API integration with samanage, I already used this library to create incidents without any issues. But when I tried to do it for the Attachment API this is not working, I also tried with postman.

 

Sample of json.

{

  "file": {

  "attachable_type":"Incident"

  "attachable_id":"XXX"  "attachment":"iVBORw0KGgoAAAANSUhEUgAAAOQAAAB4CAIAAABtkcniAAAAAXNSR0IArs4c6QAAAARnQU1BAACx

jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALTSURBVHhe7dfhbdswFIVRz5WBPI+nyTIZJrVF

SuKj6rhwYgS3OOdP6yeKJKAPBXr6hBBiJYZYiSFWYoiVGGIlhliJIVZiiJUYYiWGWIkhVmKIlRhi

JYZYiSFWYoiVGGIlhliJIVZiiJUYYiWGWIkhVmKIlRhiJYZYiSFWYoiVGGIlhliJIVZiiJUYYiWG

WIkhVmKIlRhiJYZYiSFWYoiVGGIlhliJIVZiiJUYYiWGWIkhVmKIlRhiJYZYiSFWYoiVGGIlhliJ

IdbX+7i8nU6n83v/ybNeF+v7+fqF3i4f/ef4xZZHo9t4Wn91nCzaTptDBG33/b1+2rBu2vjuhv3N

zfrkeLF5ZXko1h/ye7GW73l1p4C6rHe1fvj+c9qqlTOtGWoZr/LlhuMF2pP248FVpz3LeXxDVqzL

pHz2saHN+GIvZx8cb3J3w3KBYWmZL+ZJ2Xc8kG+IirUk0LVZ3WwO7u1y2bf6utWy4fLXvvW4dJw3

82S8QX9aT+EJL451Njayad/0cQH9vfrVaxbdHuTyyvl9WNUny7oHG7bHq/2MZV6OPEzKYPlRT+EJ

/8m/rHMJ62nLn7eH2/Fl0wcb7muHgst8NU+O68tynhIVa9ujxFWr2LV3z+fr0/awn38uez7YcLhA

OefxVY8r+L6s/2C10T77S2yrtvJqXbwNypZfblgu0FYuT8p8USbzrUroPO/3Yh3dxtPw+uZxsm+0

2ZKYrW9vC9bBXM39DZc3tuXt/X+6aj1DrD/kdbHCDxMrMcRKDLESQ6zEECsxxEoMsRJDrMQQKzHE

SgyxEkOsxBArMcRKDLESQ6zEECsxxEoMsRJDrMQQKzHESgyxEkOsxBArMcRKDLESQ6zEECsxxEoM

sRJDrMQQKzHESgyxEkOsxBArMcRKDLESQ6zEECsxxEoMsRJDrMQQKzHESgyxEkOsxBArMcRKDLES

Q6zEECsxxEqIz88/sqZ8f5qdDyoAAAAASUVORK5CYII="

  }

}

This is the result that I have

{

  "error": "param is missing or the value is empty: file"

}

 

Please don't share the link to the API/Documentation I already check that one and is not working. Attached is the file with the error.

 

Does anyone was able to create the attachment with a real json format?.

Attachments

Outcomes