REST API versioning

Hi there!

We are developing a Unity package that imports Figma designs into Unity engine automatically. We use REST API to download Figma files as json format. Whole structure built upon on the json data.

Sometimes, Figma REST API is updated and json format might be changed (breaking changes). So our implementation failed couple of times because of that.

It looks like the rest api (https://api.figma.com/v1/) has a version number, but I wonder why breaking changes are done on the same version number?

Thanks

1 Like

I don’t think there were any breaking changes. Can you share examples?

For example about “component properties” for instance swap etc.

About 2-3 months ago (I dont remember the exact date), component properties were like:

{
  "componentProperties": {
    "definitions": [
      {
        "type": "",
        "defaultValue":""
      }
    ],
    "assignments": [
      {
        "type": "",
        "value": ""
      }
    ],
    "references": {
      "mainComponent": "",
      "characters": "",
      "visible": ""
    }
  }
}

Now, It seems like:

"componentPropertyDefinitions": {
  "Label#69:0": {
    "type": "TEXT",
    "defaultValue": "Label"
  },
  "Icon#2:0": {
    "type": "INSTANCE_SWAP",
    "defaultValue": "2:4",
    "preferredValues": []
  }
}
{
  "componentPropertyReferences": {
    "mainComponent": "Icon#2:0"
  }
}
{
  "componentProperties": {
    "Icon#2:0": {
      "value": "2:4",
      "type": "INSTANCE_SWAP",
      "preferredValues": []
    },
    "Label#69:0": {
      "value": "Label",
      "type": "TEXT"
    }
  }
}
1 Like

I believe the original example you sent was never documented this way, it was more of an “accidental” release (there were no announcements or documentation on this way, so it wasn’t an “official” part of the API). I understand the frustration though.

Yes, there was no documentation about that. We found it by examining the rest api response when the “instance swap” feature had introduced. It’s good to hear that there will be no breaking change on the same version. Thanks.

Thanks for raising the issue. This was indeed an inadvertent breaking change. Our aim is for API shapes to remain stable, even if they’re not yet documented. We’re working to improve our monitoring so we catch issues like this in future earlier!

1 Like