Всякий раз, когда вы передаете токен доступа в API, это должен быть физический токен. Для этого достаточно использовать конфигурационные файлы, если токены имеют статус c, вам просто нужно прочитать токен из файла. Скажем, файл выглядит так:
# mytoken.json
{
"token": "kdvnajdfhaoejfskjvnb",
}
Вы бы загрузили его так:
from boxsdk import OAuth2, Client
import json
def load_token_from_file(token_path):
with open(token_path) as fh:
# get your token from the token key
token = json.load(fh)['token']
oauth = OAuth2(
client_id='s2dfw23wer3s6b1t4grd5grv', #don't worry these are fake
client_secret='pHgPObYY2342f2f3HIHVvPOb', #don't worry these are fake
access_token=load_token_from_path('path/to/token.json'), # now you're getting the token from the file itself
)