DHS-Mock-API
home
Overview:
Mule Soft API’s exposed to retrieve assessment events, create a new account and enroll candidates to assessments using Janison API’s.
| API Method | REST Endpoint | Description | Consumers | |
|---|---|---|---|---|
| 1. | GET | /{version}/assessments/events | Retrieves list of assessment events- Not Used anymore | Mock Exam Portal |
| 2. | POST | /{version}/candidates | Creates new account for candidates -Not Used anymore | Mock Exam Portal |
| 3. | POST | /{version}/candidates/{candidateId}/enrollments | Enroll candidates into an assessment -Not Used anymore | Mock Exam Portal |
| 4. | POST | /{version}/billings | Migrate manual billing process from mock portal to SAP. | Mock Exam Portal |
1. Flow Diagram and Description:
Mock exam portal sends request to DHS mock experience API to get list of assessment event, to create a new account for candidate and to enroll a candidate into an assessment event.

Sequence Diagram and Description:
| No. | Steps | Description |
|---|---|---|
| 1. | Input Request Message | The Mock exam portal invokes the mule services along with credentials (client id and client secret) and X-TRANSACTION-ID(A code to track API calls end to end) via Mule Soft Secure API layer with the proper query params |
| 2 | Validate the user Credentials | Client credentials are validated by the security API mule gateway layer |
| 3. | If Validation fails, service returns specific fault response | If Validation fails, service returns specific fault response |
| 4. | Send the request to specific Led layered api | The Mule soft experience API secure layer validated users request query parameters will redirect to the specific Process API. |
| 5. | Validate the request | The request is validated in the Mule System service API and if passed only then it is processed further to Process Api. |
| 6. | If Validation fails, service returns specific fault response | If the request gets failed during the validation the exception is thrown by the Process API to the Experience API secure layer. |
| 7. | Fault message redirection by the User | When Experience API layer Fails then it returns error message to the consumers |
| 8. | Connect to the Janison | Process API tries to make connection with Janison using X-API-KEY. Connection would be successful if API key is valid |
| 9. | On successful connection, Data is retrieved | Once the data is retrieved successfully, the Mule API send it back to Mock exam portal |
| 10. | Fault message redirection by the User | When Experience API layer Fails then it returns error message to the consumers |

Exception Handling:
- Custom Error handler is used to handle API Kit errors as well as user defined errors.
- HTTP endpoints have been configured with reconnection strategies with maximum of 2 retry attempts.
- SQS has been enabled with DLQ and zero message loss is ensured.
End Point details:
DHS Experience API : api/v1/assessments/events
| Topic | Details | |
|---|---|---|
| 1. | Operation Description | Retrieve the Assessments events list from Janison |
| 2. | URI | GET: /{version}/assessments/events |
| 3. | Interface Source | Mock exam portal |
| 4. | Interface Target | Janison web API |
| 5. | Synchronous/Asynchronous | Synchronous |
| 6. | Protocol | HTTPs |
| 7. | URL | https://apis-sandbox.cambridgeassessment.org.uk/cupa-dhs-mock-xapi-qa1/api/v1/assessments/events?top=20&search=lower |
| 8. | Mode of Communication | ☐ Batch ☐ Message ☒ Real Time |
| 9. | Interface Pattern | ☐ Publish / Subscribe ☒ Request / Reply |
DHS Experience API : api/v1/candidates
| Topic | Details | |
|---|---|---|
| 1. | Operation Description | Creates a new Janison Account for a candidate |
| 2. | URI | POST: /{version}/candidates |
| 3. | Interface Source | Mock exam portal |
| 4. | Interface Target | Janison web API |
| 5. | Synchronous/Asynchronous | Synchronous |
| 6. | Protocol | HTTPs |
| 7. | URL | https://apis-sandbox.cambridgeassessment.org.uk/cupa-dhs-mock-xapi-qa1/api/v1/candidates |
| 8. | Mode of Communication | ☐ Batch ☐ Message ☒ Real Time |
| 9. | Interface Pattern | ☐ Publish / Subscribe ☒ Request / Reply |
DHS Experience API : api/v1/candidates/{candidateId}/enrollments
| Topic | Details | |
|---|---|---|
| 1. | Operation Description | Enroll a candidate into an assessment event |
| 2. | URI | POST: /{version}/candidates/{candidateId}/enrollments |
| 3. | Interface Source | Mock exam portal |
| 4. | Interface Target | Janison web API |
| 5. | Synchronous/Asynchronous | Synchronous |
| 6. | Protocol | HTTPs |
| 7. | URL | https://apis-sandbox.cambridgeassessment.org.uk/cupa-dhs-mock-xapi-qa1/api/v1/candidates/{candidateId}/enrollments |
| 8. | Mode of Communication | ☐ Batch ☐ Message ☒ Real Time |
| 9. | Interface Pattern | ☐ Publish / Subscribe ☒ Request / Reply |
DHS Experience API : api/v1/billings
| Topic | Details | |
|---|---|---|
| 1. | Operation Description | Migrates manual billing process from mock portal to SAP |
| 2. | URI | POST: /{version}/billings |
| 3. | Interface Source | mock portal |
| 4. | Interface Target | SAP |
| 5. | Synchronous/Asynchronous | Synchronous |
| 6. | Protocol | HTTPs |
| 7. | URL | https://apis-sandbox.cambridgeassessment.org.uk/cupa-dhs-mock-xapi-dev/api/v1/billings |
| 8. | Mode of Communication | ☐ Batch ☐ Message ☒ Real Time |
| 9. | Interface Pattern | ☐ Publish / Subscribe ☒ Request / Reply |