# Attachments added via API

**URL:** <https://community.servicem8.com/t/attachments-added-via-api/492>\
**Category:** API & SDK\
**Created:** [August 10, 2023, 2:46am UTC](https://community.servicem8.com/t/attachments-added-via-api/492 "2023-08-10T02:46:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![developer](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@developer](https://community.servicem8.com/u/developer)\
**Post date:** [August 10, 2023, 2:46am UTC](https://community.servicem8.com/t/attachments-added-via-api/492/1 "2023-08-10T02:46:30Z")

</div>

**Originally posted by Anthony Archer**

Following this API guide:

[https://developer.servicem8.com/reference/post-attachment-create](https://developer.servicem8.com/reference/post-attachment-create)

I am trying to add an attachment to a job like this payload:

{  
“active”: 1,  
“related\_object”: “Job”,  
“related\_object\_uuid”: “9adf3227-b675-4a26-90fa-20404e82142b”,  
“file\_type”: “.png”,  
“attachment\_source”: "[https://maps.googleapis.com/maps/api/staticmap?center=-42.09278384,171.34470269&markers=-42.09278384,171.34470269&zoom=15&size=500x500&key=AIzaSyD3WoeCO2fiT-AaM8eebNvNBRsO4nGCjDE&maptype=roadmap"](https://maps.googleapis.com/maps/api/staticmap?center=-42.09278384,171.34470269&markers=-42.09278384,171.34470269&zoom=15&size=500x500&key=AIzaSyD3WoeCO2fiT-AaM8eebNvNBRsO4nGCjDE&maptype=roadmap%22),  
“photo\_width”: “500”,  
“photo\_height”: “500”,  
“attachment\_name”: “Map”  
}

Then when I query the list of attachments is shows\*\* “active”: 0:\*\*

{  
“uuid”: “f8d61167-1b0d-438a-91da-204042377e3b”,  
“edit\_date”: “2023-08-10 14:38:19”,  
\*\* “active”: 0,\*\*  
“attachment\_name”: “Map”,  
“file\_type”: “.png”,  
“photo\_width”: “500”,  
“photo\_height”: “500”,  
“attachment\_source”: “https//maps.googleapis.com/maps/api/staticmap?center=-42.09278384,171.34470269&markers=-42.09278384,171.34470269&zoom=15&size=500x500&key=AIzaSyD3WoeCO2fiT-AaM8eebNvNBRsO4nGCjDE&maptype=roadmap”,  
“lng”: 0,  
“lat”: 0,  
“tags”: “”,  
“extracted\_info”: “”,  
“created\_by\_staff\_uuid”: “5c2d82fd-e11a-4108-8e91-203dae07cedb”,  
“timestamp”: “2023-08-10 14:38:19”,  
“related\_object”: “job”,  
“related\_object\_uuid”: “9adf3227-b675-4a26-90fa-20404e82142b”  
}

Trying to update the parameter does nothing:

curl --request POST  
–url [https://api.servicem8.com/api\_1.0/attachment/f8d61167-1b0d-438a-91da-204042377e3b.json](https://api.servicem8.com/api_1.0/attachment/f8d61167-1b0d-438a-91da-204042377e3b.json)  
–header ‘accept: application/json’  
–header ‘authorization: Basic …’  
–header ‘content-type: application/json’  
–data ‘{“active”:1}’
