Skip to content

Instantly share code, notes, and snippets.

@makotot
Last active November 9, 2023 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makotot/6aa84631a746b1b0764792d033031bf4 to your computer and use it in GitHub Desktop.
Save makotot/6aa84631a746b1b0764792d033031bf4 to your computer and use it in GitHub Desktop.
figma rest api

figma REST apiについて

  • https://www.figma.com/developers/api
    • REST APIなのかFigma APIなのか
      • Figma APIぽい
    • Figma's mission is to make design accessible to everyone.

    • Figma APIは読み取りとインタラクション?をサポートしている
    • オブジェクトやレイヤーのプロパティーを抽出して、Figmaの外部で扱うことができる
    • 認証
      • アクセストークン or OAuth2
        • パーソナルアクセストークンを生成するのがAccount Settingsからできる
          • X-Figma-Tokenをリクエストヘッダーに入れて使う
        • 推奨されているのはOAuth2
          • アプリケーションを登録する必要がある
    • HTTPのエンドポイントを介してアクセス
      • files, images, file versions, users, comments, team projects, project files
    • アクセス許可されると、ファイルをJSONで表現されたデータで見れる
      • GET or POSTでファイルやレイヤーへのコメントの取得、追加などもできる
    • scopes
      • files:read
      • file_variables:read / file_variables:write
      • file_comments:write
      • file_dev_resources:read / file_dev_resources:write
      • webhooks:write
    • files
      • ノードツリー
        • DOCUMENTがルート
        • CANVASがはえる。これはPAGEを示している?
        • CANVASには任意の子ノードがはえる
        • ノードにはグローバルなものとノード固有のものがある?
      • ノードの種別
        • DOCUMENT
        • CANVAS
        • FRAME
        • GROUP
        • SECTION
        • VECTOR
        • BOOLEAN_OPERATION
        • STAR
        • LINE
        • ELLIPSE
        • REGULAR_POLYGON
        • RECTANGLE
        • TABLE
        • TABLE_CELL
        • TEXT
        • SLICE
        • COMPONENT
        • COMPONENT_SET
        • INSTANCE
        • STICKY
        • SHAPE_WITH_TEXT
        • CONNECTOR
        • WASHI_TAPE
      • プロパティ
        • Color
        • ExportSetting
        • Constraint
        • Rectangle
        • ArcData
        • BlendMode
        • MaskType
        • EasingType
        • FlowStartingPoint
        • LayoutConstraint
        • LayoutGrid
        • Effect
        • Hyperlink
        • DocumentationLink
        • Paint
        • Vector
        • Size
        • Transform
        • ImageFilters
        • FrameOffset
        • ColorStop
        • PaintOverride
        • TypeStyle
        • Component
        • ComponentSet
        • Style
        • ShapeType
        • ConnectorEndpoint
        • ConnectorLineType
        • ConnectorTextBackground
        • ComponentPropertyDefinition
        • ComponentProperty
        • ComponentPropertyType
        • InstanceSwapPreferredValue
        • PrototypeDevice
        • StrokeWeights
        • Overrides
        • VariableAlias
    • comments
    • users
    • version history
    • projects
    • component and styles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment