• RSS Feed

Last modified on 9/2/2020 5:36 PM by User.

Tags:

Brainfuse API

Brainfuse API utilizes an apiKey that is provided to the client upon request. The apiKey is specific to an Admin user as well as the account which the Admin user belongs to.

Brainfuse has many other APIs that have not been made public yet. Please contact your account manager if there is an API that you need that is not listed here.

Base URL

The url for all of the API endpoints mentioned below is https://www.brainfuse.com/api/v1

Security

In order to access the API first a call must be made to:

 

  1. Request /api/v1/token passing the apiKey form parameter.
  2. Upon successful authentication the API will respond with:

1:
2:
3:
4:
5:
6:
7:
8:
9:
{

"token": "p3~F90EDB437C55411CBFA1DDDCBFA39D93",

"timeZone": "-05:00",

"targetTimeZone": "America/New_York"

}

Where the token value needs to be passed as is in the Authorization header of each subsequent API call. Keep in mind there is no "Bearer" before the value of the token in the header.

 

 

 Grade Topics/Subjects

/subjects/gradeTopic

a call to this api will return a json object equivalent to following:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
{

  "status": "200",

  "gradeLabel": "Topic",

  "subjectLabel": "Subject",

  "gradePlural": "Topics",

  "subjectPlural": "Subjects",

  "grades": [

    {

      "grade": "-1",

      "label": "-- Select Topic --",

      "topics": [

        {

          "id": -1,

          "topic": "-- Select Subject --",

          "subjectID": -1

        }

      ]

    },

    {

      "grade": "Business",

      "label": "Business",

      "topics": [

        {

          "id": -1,

          "topic": "-- Select Subject --",

          "subjectID": -1

        },

        {

          "id": 210,

          "topic": "Accounting",

          "subjectID": 210,

          "categoryID": 150422

        },

        {

          "id": 208,

          "topic": "Economics",

          "subjectID": 208,

          "categoryID": 150423

        },

        {

          "id": 698,

          "topic": "Finance",

          "subjectID": 698,

          "categoryID": 150586

        }

      ]

    }

    

  ]

}

Reporting 

/account/{accountID}/reports/usage?startDate={MM/dd/yyyy}&endDate={MM/dd/yyyy} 

where:

accountID is the accountID provided by Brainfuse for your account.

startDate is the startDate inclusive of the reporting period

endDate is the endDate inclusive of the reporting period

 

Connecting to a live tutor

In order to be able to connect a user from a client site to a live tutor, the client site will most likely utilize the Grade Topics endpoint to display the grades and subjects. When the user select a specific subject or if automatically selected by the client system. The client will open a new browser to the following URL. 

https://landing.brainfuse.com/livehelp

The URL supports the following parameters, parameters in bold are required:

  1. subjectID : that is the value of the subjectID from the json response for the Grade Topics response above.
  2. user_id : the unique stable id on the client's system. The first time the user accesses Brainfuse a new Brainfuse user account will be generated and linked to the provided id. On subsequent visits the user will be connected to the same account that was generated during their first visit.
  3. lis_person_name_fname user's first name
  4. lis_person_name_lname user's last name.
  5. lis_person_contact_email_primary email address of the user
  6. Oauth parameters:
    1. Since Brainfuse utilize Oauth 1.0 to allow Basic LTI support. the URL must be signed using the consumer key and secret that will be provided to the client by Brainfuse staff. The oauth signing method is HMAC-SHA1. 
    2. An example of complete live help url is 
    3. https://landing.brainfuse.com/livehelp?subjectID=xxxxxx&oauth_callback=about%3Ablank&oauth_consumer_key=Key&oauth_nonce=3576405204705548274&oauth_signature=l6R08WeeiTvkwIgMaPB%2BOV7oR9g%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1570536544&oauth_version=1.0
    4. For more details on Oauth single sign-on please visit Single Sign Specification using Oauth 1.0 HMAC article