Add Attachment
Use this operation to add new Attachment object.
Parameters
Body Params | |
---|---|
JSON: | json Attachment details needs to be passed as body parameter,it should be in JSON format. |
XML: | string Attachment details needs to be passed as body parameter,it should be in XML format. |
Path Params | |
---|---|
yourCompany: | string The Company name need to passed in the base URL.For eg. if you enter xyzcompany name, the url https://{yourCompany}.agiliron.net/agiliron/api-40.php/Attachment will change to https://xyzcompany.agiliron.net/agiliron/api-40.php/Attachment |
Header Params | |
---|---|
Accept: | string Response header need to be passed for eg. application/json or application/xml. |
Query Auth | |
---|---|
key: | string API key needs to be passed in this variable.The option to enter API key will appear when you click on Try it button.This will be the first option in AUTHENTICATION block.Default is SET to 0. |
Header Auth | |
---|---|
apiKey: | string Dedicated API key needs to be passed in this variable via header.The option to enter API key will appear when you click on Try it button.This will be the second option in AUTHENTICATION block.Default is SET to 0. |
Sample Code
{
"Attachments": {
"Attachment": [{
"Name": "Chrysanthemum.jpg",
"Type": "image/jpeg",
"RelatedTo": "Orders",
"RelatedId": "25761",
"AttachmentContent": "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
"CreatedTime": "12-14-2020 19:25:24",
"ModifiedTime": "12-14-2020 19:25:24",
"Description": "Test SO image"
}]
}
}
<Attachments>
<Attachment>
<Name>Chrysanthemum.jpg</Name>
<Type>image/jpeg</Type>
<RelatedTo>Orders</RelatedTo>
<RelatedId>25761</RelatedId>
<AttachmentContent>R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==</AttachmentContent>
<CreatedTime>12-14-2020 19:25:24</CreatedTime>
<ModifiedTime>12-14-2020 19:25:24</ModifiedTime>
<Description>Test SO image</Description>
</Attachment>
</Attachments>
Sample Response
{
"MCM": {
"response": {
"objectType": "Attachment",
"syncTime": "2021-06-10 03:23:14"
},
"parameters": {
"results": {
"message": {
"status": "Success",
"success_message": {
"attachment_name": "Chrysanthemum.jpg",
"attachment_id": "203060"
}
}
}
}
}
}
<MCM>
<response>
<objectType>Attachment</objectType>
<syncTime>2021-06-10 03:23:14</syncTime>
</response>
<parameters>
<results>
<message>
<status>Success</status>
<success_message>
<attachment_name>Chrysanthemum.jpg</attachment_name>
<attachment_id>203060</attachment_id>
</success_message>
</message>
</results>
</parameters>
</MCM>
WADL
<?xml version="1.0" encoding="UTF-8"?>
<application>
<resources base="https://{yourCompany}.agiliron.net/agiliron/api-40/">
<resource path="Ticket">
<method name="POST">
<request>
<param name="key" type="xsd:string" style="query" required="true" />
<param name="AttachmentId" type="xsd:int" style="body" required="true" />
<param name="Type" type="xsd:String" style="body" />
<param name="RelatedTo" type="xsd:String" style="body" />
<param name="RelatedId" type="xsd:int" style="body" />
<param name="AttachmentContent" type="xsd:string" style="body" />
<param name="CreatedTime" type="xsd:dateTime" style="body" />
<param name="ModifiedTime" type="xsd:dateTime" style="body" />
<param name="Description" type="xsd:string" style="body" />
<AttachmentId>36189</AttachmentId>
</request>
<response status="200">
<representation mediaType="application/xml" element="yn:ResultSet" />
</response>
<response status="400">
<representation mediaType="application/xml" element="ya:Error" />
</response>
</method>
</resource>
</resources>
</application>
Updated 11 months ago