Hi,
I created small web plugin which created template on miro. But when I moved the same components so they are created by REST app I started getting errors in seemingly random places.
First issue
{
"type": "line",
"startPosition": {
"x": 0,
"y": 0
},
"endPosition": {
"x": 1000,
"y": 0
}
}
{
"status" : 400,
"code" : "invalidParameters",
"message" : "Method arguments are not valid",
"context" : {
"fields" : : {
"field" : "",
"message" : "object has properties which are not allowed: :\"endPosition\",\"startPosition\"]",
"reason" : "invalidParameter"
}, {
"field" : "",
"message" : "object has missing required properties ( \"endWidget\",\"startWidget\"])",
"reason" : "invalidParameter"
} ]
},
"type" : "error"
}
I do not have widgets to attach this line to.
Second issue
{
"type": "shape",
"x": 0,
"y": 0,
"text": "Monday",
"width": 50,
"height": 50,
"style": {
"borderWidth": 2,
"backgroundColor": "#B2EEE4"
}
}
{
"status" : 400,
"code" : "invalidParameters",
"message" : "Method arguments are not valid",
"context" : {
"fields" : " {
"field" : "style.borderWidth",
"message" : "value (0) not found in enum (possible values: e2,4,8,16,24])",
"reason" : "invalidParameter"
} ]
},
"type" : "error"
}
Why I cannot have borders with 0 width?
Third issue
{
"type": "text",
"x": -37,
"y": 0,
"text": "uno",
"width": 100,
"rotation": 270,
"style": {
"fontSize": 12,
"textColor": "#B2EEE4",
"textAlign": "c"
}
}
{
"status" : 400,
"code" : "invalidParameters",
"message" : "Method arguments are not valid",
"context" : {
"fields" : " {
"field" : "style.textAlign",
"message" : "value (\"c\") not found in enum (possible values: e\"center\",\"right\",\"left\"])",
"reason" : "invalidParameter"
} ]
},
"type" : "error"
}
I literally had three different (in my opinion simple) type of components and I got three different errors.
Fourth issue
This may be question. I tried to use capability: {editable: false}
but I was still able to change widget as user. To my knowledge this has no relation to locking, and locking is not available via api.
---
Also why https://developers.miro.com/reference/create-board-widgets wont allow passing list as argument? Performance impact should be the same as using it in browser via plugin api.
There are others differences like no tags support but those are at least documented.
my apologies if message is a bit aggressive but I’m trying to build something under time pressure and those surprises are not helping :(
Thanks