Git Product home page Git Product logo

webflow_api's Introduction

Webflow API

This Webflow API package is aimed to facilitate communicating with the Webflow Content Management System (CMS).

The package could be used to develop admin apps to manage Webflow sites' content, e.g., blogs, events.

The package communicates with the Webflow API via the HTTPS methods. The design of the package is inspired by the official Webflow API npm package.

This package is not officially supported by Webflow.

Features

The package provides functions to:

  • Fetch collections
  • Fetch a collection by collection ID
  • Fetch items in a collection
  • Fetch a collection item by item ID
  • Create a new collection item
  • Delete a collection item
  • Update the fields of an item

Getting started

To set up the package, first install the package.

flutter pub add webflow_api
  1. Then generate an Webflow API token. You can find instructions in the official Webflow documentation here.

  2. Retreive the Webflow project ID (Site ID) from the Webflow project settings dashboard.

  3. Set up the Webflow object.

import 'package:webflow_api/webflow_api.dart';

const siteId = "insert site ID here";
const authToken = "insert auth token here";

void main() async {
  Webflow webflow = Webflow(token: authToken, siteId: siteId);
}

The official CMS API reference can be found here. Note that not all the API methods are currently implemented in this package.

Usage

Setup

const siteId = "insert site ID here";
const authToken = "insert auth token here";
Webflow webflow = Webflow(token: authToken, siteId: siteId);

Fetch all collections

// Fetch all the CMS Collections 
List<Collection> collections = await webflow.collections();
// Display the ID and fields of the first collection
print(collections[0].id);
print(collections[0].fields);

Fetch Item by ID

// Fetch an item from a collection by ID
const collectionId = "insert collection ID";
const itemId = "insert item ID";
ItemsResponse fetchedItem = await webflow.item(collectionId: collectionId, itemId: itemId);
// Print fetched item name and slug
print(fetchedItem.items[0].name);
print(fetchedItem.items[0].slug);

Additional information

Package developed by Ahmed ElBatanony, as part of a Flutter course at Innopolis University.

webflow_api's People

Stargazers

 avatar

Watchers

 avatar

Forkers

krohnmi xvrh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.