In this wiki it will be explained how to access to the different endpoints from the Stockmind Platform.

How to Authenticate

At the first instance it is required to autenticate in the plataform to obtain a jwt access token to the API.

Please, go to this URL in your browers to authenticate : https://your-domain.com/v2/authenticate

To delete the session: https://your-domain.com/v2/logout

When you are authenticated with your account, it will be required that you give access to our Stockmind:

When you are authenticated and giving the allow access to the platform, you will be redirected to the Stockmind API.

How to access to API

When you are autheticated throw Auth0 you will be redirected to Stockmind API website in your browser or mobile aplication.

The browser is using an API JWT token to identify you when you try to access to the Stockmind API. And this JWT token will be necesary to use the API with your credentials.

To obtain the JWT token, in your browser where you sign in: 1. Go to /v2/users endpoint 2. Run “Inspector” in your browers (Ctrl + Uppercase + I). 3. Go to Applitation tab in the browser inspector. In the tree on the left side, go to Storage and select “Cookies”. 4. Select in the list the cookie from Stockmind website. 5. Copy the text from Value (eyJHb...) from the Name PLAY_SESSION.

To use your JWT token in a shell with curl:

export AUTH0_SESSION="eyJHb...";

Or you can get the JWT from Stockmind Callback in the URL after https://your-domain.com/redirect?token=

Create an API key

Create a Stockmind API-KEY from the authenticated user to use in the Stockmind API platform.

  • POST /v2/apikey
curl -X POST -H 'Cookie: PLAY_SESSION='${AUTH0_SESSION}'' https://your-domain.com/v2/apikey

Or:

curl -X POST -H 'X-Auth-Token: <token>' https://your-domain.com/v2/apikey

From now on you can use this Api-Key to use on the endpoints from Stockmind

Response:

{"api_key":"7318ed07-1565-4c33-9688-75fe3e7835c0"}