Quick Start

Get up and running with the StudyHQ Partner API in minutes: authenticate, generate a student’s assessment link, and fetch their results.


Prerequisites

Before you begin, make sure you have:

  • A StudyHQ partner account (contact support@studyhq.com to get onboarded)
  • Your project’s TokenId and TokenSecret
  • Your projectId (provided during onboarding)

Authenticate

The Partner API uses token-based authentication. Tokens are issued per project during onboarding as a pair of credentials:

CredentialDescription
TokenIdPublic identifier for the token
TokenSecretSecret used to authenticate — shown only once at creation

The TokenSecret is shown only once when the token is created. Store it securely — if it’s lost, the token must be regenerated.

Include the token in every request via the X-Access-Token header, formatted as TokenId:TokenSecret:

HeaderValue
X-Access-Token<TokenId>:<TokenSecret>
Content-Typeapplication/json
Acceptapplication/json

Step 1 — Generate an assessment URL

After a student registers (or completes payment) on your platform, call the API to generate a unique assessment link.

$curl -X POST https://api.studyhq.com/partner/get-redirect-url \
> -H "Content-Type: application/json" \
> -H "X-Access-Token: <TokenId>:<TokenSecret>" \
> -d '{
> "projectId": "L4ndb5PYxM",
> "name": "Student name",
> "email": "student@gmail.com",
> "mobile": "9876543210"
> }'

Response:

1{
2 "redirect-url": "https://app.studyhq.com/L4ndb5PYxM/assessment?token=eyJhbGciOiJSU..."
3}

Open the redirect-url in a new tab for the student to begin the assessment.

The redirect URL is time-bound and single-use. Generate a fresh URL each time a student needs to take the assessment.


Step 2 — Student completes the assessment

The student takes the assessment on StudyHQ. Results are stored against their email.

StatusMeaning
CompletedStudent finished the assessment
AbandonedStudent did not finish

Step 3 — Fetch results

Once the student has completed the assessment, retrieve their results and course recommendations.

$curl -X POST https://api.studyhq.com/partner/get-assessments-info \
> -H "Content-Type: application/json" \
> -H "X-Access-Token: <TokenId>:<TokenSecret>" \
> -d '{
> "projectId": "L4ndb5PYxM",
> "email": "student@gmail.com"
> }'

Response:

1[
2 {
3 "AssessmentId": "AnE9YIqu5plq",
4 "Status": "Completed",
5 "Recommendations": [
6 "Fashion Design",
7 "Entrepreneurship & Family Business"
8 ],
9 "AssessmentDuration": "1m 58s"
10 }
11]

Use the Recommendations array to display personalised course options to the student on your platform.


Token lifecycle & security

EventBehaviour
Token createdSecret is shown once — copy it immediately
Secret lostToken must be deleted and regenerated
Token revokedRequests using that token fail with 401
Token scopeRestricted to a single project

Best practices

  • Never expose the X-Access-Token header in client-side code or browser requests.
  • Don’t log raw request headers in your application.
  • Rotate tokens periodically, or immediately if compromised.
  • Contact support@studyhq.com for token revocation or rotation.

What’s next