# New to Sandbox, simple question

**URL:** <https://discuss.dwolla.com/t/new-to-sandbox-simple-question/3884>\
**Category:** API Support\
**Created:** [March 13, 2017, 12:24am UTC](https://discuss.dwolla.com/t/new-to-sandbox-simple-question/3884 "2017-03-13T00:24:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikearul](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mikearul](https://discuss.dwolla.com/u/mikearul)\
**Post date:** [March 13, 2017, 12:24am UTC](https://discuss.dwolla.com/t/new-to-sandbox-simple-question/3884/1 "2017-03-13T00:24:32Z")

</div>

I’m just trying out the UAT environment with Python, using some sample code. I’ve installed dwollav2 successfully, but get the following error.

name ‘account\_token’ is not defined.

The code is “transfer = account\_token.post(‘transfers’, request\_body)”

I think I need help understanding the commands to gain access to the API in the first place.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![stephen](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/stephen/32/2936_2.png) [@stephen](https://discuss.dwolla.com/u/stephen)\
**Post date:** [March 13, 2017, 3:15pm UTC](https://discuss.dwolla.com/t/new-to-sandbox-simple-question/3884/2 "2017-03-13T15:15:30Z")

</div>

Hey Mike,

Before you are able to use an `account_token` you’ll need to either generate one [here](https://uat.dwolla.com/applications) or obtain one by going through the OAuth flow. There are some examples at [https://github.com/Dwolla/dwolla-v2-python#account-tokens](https://github.com/Dwolla/dwolla-v2-python#account-tokens) that explain how to instantiate an `account_token` using either method. If you have any questions please let us know.

---

<div class="post-metadata">

**Author:** ![Michael\_Arulgnanendr](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Michael\_Arulgnanendr](https://discuss.dwolla.com/u/Michael_Arulgnanendr)\
**Post date:** [March 13, 2017, 10:55pm UTC](https://discuss.dwolla.com/t/new-to-sandbox-simple-question/3884/4 "2017-03-13T22:55:24Z")

</div>

Hi Stephen,

I took another look at the instantiate code and am using that to define the account\_token using the access token and refresh token generated by the sandbox Apps page. Python is running into an error saying “name ‘client’ is not defined” . I thought client.Token would have been a function defined by the dwollav2 package.

account\_token = client.Token(access\_token = ‘…’, refresh\_token = ‘…’)

---

<div class="post-metadata">

**Author:** ![Michael\_Arulgnanendr](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Michael\_Arulgnanendr](https://discuss.dwolla.com/u/Michael_Arulgnanendr)\
**Post date:** [March 13, 2017, 11:11pm UTC](https://discuss.dwolla.com/t/new-to-sandbox-simple-question/3884/5 "2017-03-13T23:11:41Z")

</div>

I was able to define client using some more code I found on github (below), but now Python is saying ‘os’ is not defined.

I entered the relevant app key and app secret from my UAT dashboard.

client = dwollav2.Client(  
key = os.environ[‘DWOLLA\_APP\_KEY’],  
secret = os.environ[‘DWOLLA\_APP\_SECRET’],  
on\_grant = lambda t: save(t)  
)

---

<div class="post-metadata">

**Author:** ![Michael\_Arulgnanendr](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Michael\_Arulgnanendr](https://discuss.dwolla.com/u/Michael_Arulgnanendr)\
**Post date:** [March 16, 2017, 6:52am UTC](https://discuss.dwolla.com/t/new-to-sandbox-simple-question/3884/6 "2017-03-16T06:52:58Z")

</div>

resolved. thanks
