Home - GastonBC/adeskForgeWrapper GitHub Wiki

Full API Reference https://gastonbc.github.io/index.html

Docs Index:

Setting up credentials and getting a 2 legged token

Notice we will use our token in most methods

import adeskForgeWrapper as afw

#Your Forge app credentials, strings in every field
forge_client_id = 'FORGE_CLIENT_ID'
forge_client_secret = 'FORGE_CLIENT_SECRET'

# Your B360 hub ID and name
bim_account_id = 'BIM360_ACC_ID'
bim_account_name = 'BIM360_ACC_NAME'

# We are going to need our token in most methods
cli = afw.client.Client(forge_client_id, forge_client_secret, bim_account_id, bim_account_name)
token = afw.client.Token.get_2_legged_token("account:read", cli)

Getting a 3 legged token with implicit grant

Some methods require an authentication process, for example those in the Token Flex module.

# We will need to provide a callback URL, this one needs to be the same 
# url you used to register your Forge app

callback_url = "http://localhost:8000/callbacks"

cli = afw.client.Client(forge_client_id, forge_client_secret, bim_account_id, bim_account_name)

# Provide the URL in the method and copy the full 
# response URL you are taken to after logging

token = afw.client.Token.get_3_legged_token("data:read", cli, callback_url)
This is a work in progress