New Login

Requests the creation of a new login session.

  • Path: /publicapi/login
  • Method: POST
  • Request:
$ curl -X POST -H "Content-Type: application/json" -d '{"source": string}' https://www.deepcode.ai/publicapi/login

The source parameter is optional and identifies the service using the DeepCode APIs.


Status CodeResponse
200
{
"sessionToken": string,
"loginURL": string (uri),
}

Returns the newly created sessionToken and the loginURL to complete the login flow. Once the login process has been completed in a browser, the sessionToken can be used to authenticate the user in the other API requests. Authentication is required for every other API in one of the following ways:

  • Query:
?sessionToken=string
  • Header:
"Session-Token: string"

 

Check Session

Checks status of the login process.

  • Path: /publicapi/session
  • Method: GET
  • Request:
$ curl -X GET -H "Session-Token: string" https://www.deepcode.ai/publicapi/session
Status CodeResponse
200The login process was successful
304The login process has not been completed yet
401Missing or invalid sessionToken

If the login flow is incomplete, it returns status code 304. Otherwise, it returns status code 200.