Skip to main content
Answered

Changing a shape via Api


Forum|alt.badge.img+3

One last question for now:

What is the code for updating an items it’s content? I tried it with:

url = f'https://api.miro.com/v2/boards/{board_id}/items/{item_id}'
data = {"data": {"content": "<p>123</p>"}}headers = {    "accept": "application/json",    "authorization": f"Bearer {access_token}",}response = requests.patch(url, json=data, headers=headers)

Can you help me? And where can I find all the possibilities?

Best answer by William Bishop

Hi @Ernst van der Heijden,

If you want to update a shape’s content, you can make a PATCH request to the Shape endpoint. You can find the PATCH endpoint for each supported item type in our API Reference—here’s the documentation for updating a shape:

https://developers.miro.com/reference/update-shape-item

 

And here’s an example PATCH request in cURL:

curl --request PATCH \
     --url https://api.miro.com/v2/boards/boardId/shapes/itemId \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "data": {
    "content": "123"
  }
}
'


I hope it helps!

View original
Was it helpful?

2 replies

William Bishop
Mironeer
Forum|alt.badge.img+4

Hi @Ernst van der Heijden,

If you want to update a shape’s content, you can make a PATCH request to the Shape endpoint. You can find the PATCH endpoint for each supported item type in our API Reference—here’s the documentation for updating a shape:

https://developers.miro.com/reference/update-shape-item

 

And here’s an example PATCH request in cURL:

curl --request PATCH \
     --url https://api.miro.com/v2/boards/boardId/shapes/itemId \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "data": {
    "content": "123"
  }
}
'


I hope it helps!


Forum|alt.badge.img+3

Thanks a million!


Reply