Beginner
13m read

User Preferences

1

Item Model

The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items:

const Webflow = require('webflow-api')
const webflow = new Webflow({ token: 'd59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32' })

webflow.info()
 .then(info => console.log(info))

const Webflow = require('webflow-api')
const webflow = new Webflow({ token: 'd59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32' })

webflow.info()
 .then(info => console.log(info))

2

How to use the API

If you’re new to developing on APIs, this is a great place to start. You’ll learn in this guide how to make the simplest Asana API request -- getting your user information.

{

 "data": {

   "gid": "12e345a67b8910c11",

   "email": "jonsnow@example.com",

   "name": "Jon Snow",

   "photo": {

     "image_21x21": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_21x21.png",

     "image_27x27": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_27x27.png",

     "image_36x36": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_36x36.png",

     "image_60x60": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_60x60.png",

     "image_128x128": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_128x128.png"

   },

   "resource_type": "user"

 }

}

{

 "data": {

   "gid": "12e345a67b8910c11",

   "email": "jonsnow@example.com",

   "name": "Jon Snow",

   "photo": {

     "image_21x21": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_21x21.png",

     "image_27x27": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_27x27.png",

     "image_36x36": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_36x36.png",

     "image_60x60": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_60x60.png",

     "image_128x128": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_128x128.png"

   },

   "resource_type": "user"

 }

}

3

Common Usecases

Collaboration across teams and tools works best when everyone stays in sync and processes flow easily and without friction. This is why we have Asana's API: it's a platform to ensure all of your information is up to date and that your teams stay efficient and in the loop.

# replace with your personal access token. 

personal_access_token = '0/123456789....'


# Construct an Asana client

client = asana.Client.access_token(personal_access_token)

# Set things up to send the name of this script to us to show that you succeeded! This is optional.

client.options['client_name'] = "hello_world_python"


# Get your user info

me = client.users.me()


# Print out your information

print("Hello world! " + "My name is " + me['name'] + "!")

# replace with your personal access token. 

personal_access_token = '0/123456789....'


# Construct an Asana client

client = asana.Client.access_token(personal_access_token)

# Set things up to send the name of this script to us to show that you succeeded! This is optional.

client.options['client_name'] = "hello_world_python"


# Get your user info

me = client.users.me()


# Print out your information

print("Hello world! " + "My name is " + me['name'] + "!")

4

Item Model

The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items:

const Webflow = require('webflow-api')
const webflow = new Webflow({ token: 'd59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32' })

webflow.info()
 .then(info => console.log(info))

const Webflow = require('webflow-api')
const webflow = new Webflow({ token: 'd59f681797fbb3758b2a0ce8e5f31a199e2733110cb468bb2bb0d77f23417b32' })

webflow.info()
 .then(info => console.log(info))

5

How to use the API

If you’re new to developing on APIs, this is a great place to start. You’ll learn in this guide how to make the simplest Asana API request -- getting your user information.

{

 "data": {

   "gid": "12e345a67b8910c11",

   "email": "jonsnow@example.com",

   "name": "Jon Snow",

   "photo": {

     "image_21x21": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_21x21.png",

     "image_27x27": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_27x27.png",

     "image_36x36": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_36x36.png",

     "image_60x60": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_60x60.png",

     "image_128x128": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_128x128.png"

   },

   "resource_type": "user"

 }

{

 "data": {

   "gid": "12e345a67b8910c11",

   "email": "jonsnow@example.com",

   "name": "Jon Snow",

   "photo": {

     "image_21x21": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_21x21.png",

     "image_27x27": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_27x27.png",

     "image_36x36": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_36x36.png",

     "image_60x60": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_60x60.png",

     "image_128x128": "https://s3.amazonaws.com/profile_photos/121110987654321.hJGlskahcKA5hdslf4FS_128x128.png"

   },

   "resource_type": "user"

 }

Next doc

Try Engrafa — it's free

Engrafa is number one project managment tool. Make your team collaboration as seamless as possible.

Go to Engrafa.com