Test with real assessments
Create and publish assessments in your Edpire dashboard before testing your integration. Your API key gives access to the same assessments your learners will see — no separate test environment needed.Test the complete flow end-to-end
Before going live, run through the full learner journey with your chosen integration pattern:Hosted Redirect
Hosted Redirect
- Build the share URL with your assessment’s share code
- Open it in a private browser window (to simulate a fresh learner session)
- Complete the assessment
- Verify the redirect lands on your
return_urlwithsubmission_id,score, andmax_scoreappended - Fetch the submission via
GET /api/v1/submissions/{id}and confirm the response shape matches your data model
Embedded Player
Embedded Player
- Mint an embed token from your server via
client.mintEmbedToken() - Call
EdpireAssessment.mount({ token, container })in the browser - Complete the assessment — verify the player mounts, renders questions, and accepts answers
- Submit and confirm
onCompletefires with the correctresultshape - Verify per-question feedback is shown inline after submission
Custom Flow
Custom Flow
- Fetch an assessment through your backend proxy and flatten with
flattenAssessment() - Render each step with your custom UI using
EdpireQuestionorrenderQuestion - After each answer, call your
/checkproxy — verifyfeedbackshape matches the question type - Confirm
correct: truefeedback is returned for known-correct answers - After all questions, submit via
client.submit()and verify the full submission record
Test webhooks locally
Your local server isn’t reachable from Edpire’s servers directly. Use ngrok or Cloudflare Tunnel to expose a local port:secret from the response. Complete an assessment — the webhook fires to your local handler in real time.
Verify signature verification
Confirm your signature verification logic rejects tampered requests:Test idempotency
The same webhook event can be delivered more than once. Your handler must be safe to call twice with the same payload:- Complete an assessment — your handler processes the
submission.gradedevent - Replay the exact same POST body to your webhook handler (copy from ngrok’s request log)
- Verify your database has exactly one record, not two
Test error paths
Don’t only test the happy path. Verify your integration handles:| Scenario | How to trigger |
|---|---|
| Invalid API key | Use a wrong or revoked key — expect 401 |
| Missing scope | Use a key without read:results on a submissions call — expect 403 |
| Assessment not found | Request a non-existent assessment ID — expect 404 |
| Max attempts exceeded | Submit the same assessment more than its allowed attempt count — expect 409 |
| Rate limit | Send 101+ requests per minute — expect 429 with Retry-After header |
Pre-production checklist
Before switching to production keys:- All API calls go through your server — no
edp_live_keys in the browser -
return_urlandback_urlare on registered Allowed Origins - Webhook signature verification is enabled and tested
- Idempotency check is in place for
submission.graded - Error responses are handled (retry on 429/500, alert on persistent 5xx)
-
learner_refis your stable internal user ID — not email, not username -
EDPIRE_API_KEYis in environment variables, not committed to source control