Skip to main content

Hello, 

I am trying to update connector color, but it fails if it is not connected to the card.

Using the Miro API document https://developers.miro.com/reference/update-connector, I executed the following command to change the connector color to the red.

echo '{"style":{"strokeColor":"#FF0000"}}' |  \
  http PATCH https://api.miro.com/v2/boards/board_id/connectors/connector_id \
  accept:application/json \
  authorization:'Bearer HIDDEN' \
  content-type:application/json

This request works if both the two teminals of the connector is attached to the cards. 

 

However, if at least one terminal is not connected, it returns the following error:

{
"type": "error",
"code": "operationNotSupported",
"message": "Operation not supported",
"status": 400
}

 

Is there any workaround to fix this?

Hi @Takeshi Mizumoto,

 

Thank you for your message and for using the REST API!

The board UI allows users to create connectors with only one terminal (start) point. Was the connector whose color you tried to update created manually on the board UI?

In this case, the workaround you describe is indeed the best way to update the connector programmatically: "This request works if both the two terminals of the connector are attached to the cards."

To create and to perform CRUD operations on connectors with the REST API and the Web SDK, it is necessary to specify both a start and an end point for the connector line. It's not possible to create a connector programmatically with only one terminal point.

Updating the properties of a connector always requires specifying both start and end points. This is why the operation worked when you attached the dangling connector to link 2 board items, but failed when the connector was dangling (only one terminal point).

See also:

Let me know if this answer helps, or if you have any further questions!

 

Best,

marco

Technical writer | DevX | Platform developer support


Hi @Marco Spinello 

Thank you for the answer. As you mentioned, the connector is created manually.

I got the situation. It would be great if the team added a function to change the connectors' style even if it is not connected.

 

Thank you!

Takeshi


Reply