bigcommerce/bigcommerce-api-python

Is there any side-effect on api

Closed this issue · 2 comments

Should I somehow clear any session on the api after using it for future use.

In bigcommerce/hello-world-app-python-flask at line #93 it mentions a side-effect behavior, or maybe I got it wrong.

Currently some of my app unit-tests pass or fail on a simple api connection test and the error is Authorization issue. I'm wondering if I need to take care of clearing the "session" object or some sort after using the api for couple of store.

By the way, shopify python api wrapper requires clearing the session header after api usage to be able to use it for another api connection:

shopify.ShopifyResource.clear_session()

The BigCommerceApi class is responsible for storing session information. That is, each instance created using

client = bigcommerce.api.BigcommerceApi(client_id, store_hash)

will store its own session.

The side effect mentioned in the hello world app also operates on the client object. In addition to returning the token, oauth_fetch_token modifies the client to be able to make OAuth requests.

@tgsergeant That makes sense.
Thank you for response.

I close this issue then.