Skip to main content

01Developers

API reference

Read the course list, course categories, approved centres and events, and check a certificate by number. JSON over HTTPS.

At a glance

Base URL
https://new.oshawards.com/api/v1
Format
JSON
Sign-in
Bearer token, only for learner endpoints
Limit
60 requests a minute per user or IP address

Getting started

All endpoints start with /api/v1. Endpoints that read courses, categories, centres, events and certificates need no sign-in.

GET https://new.oshawards.com/api/v1/centres?country=Oman
Accept: application/json

Signing in

The learner endpoints use a token. Get one from POST /api/v1/login or POST /api/v1/register, then send it with each request:

Authorization: Bearer YOUR_TOKEN

Responses

Lists that are paginated return data, links and meta; ask for another page with ?page=2. Single records and the other endpoints return success and data.

Learner accounts

MethodEndpointSign-inWhat it returns
POST /api/v1/login No Sign in with a learner email and password and receive a token. Limit: 5 requests a minute.
POST /api/v1/register No Create a learner account and receive a token. Limit: 3 requests a minute.
POST /api/v1/logout Token Revoke the token used for the request.
GET /api/v1/profile Token The signed-in learner: id, name, email and when the account was created.

Sign-in request

POST /api/v1/login
Content-Type: application/json

{
    "email": "learner@example.com",
    "password": "your password"
}

Sign-in response

{
    "success": true,
    "message": "Login successful",
    "data": {
        "user": { "id": 1, "name": "Example Learner", "email": "learner@example.com" },
        "token": "1|...",
        "token_type": "Bearer"
    }
}

Registration takes name, email, password (at least 8 characters) and password_confirmation, and answers with status 201 and the same shape.

Courses

MethodEndpointSign-inWhat it returns
GET /api/v1/courses No Active courses in title order, 20 a page.
GET /api/v1/courses/{id} No One course by its id.
GET /api/v1/categories No Active course categories (subjects) in title order. Not paginated.

A course in the list

{
    "id": 1,
    "title": "Course title",
    "slug": "course-title",
    "description": "Plain text, tags removed",
    "image": "https://new.oshawards.com/images/thumb/example.jpg",
    "level": "Level 2",
    "duration": "...",
    "assessment": "...",
    "category_id": 5
}

Approved centres

MethodEndpointSign-inWhat it returns
GET /api/v1/centres No Approved centres in name order, 20 a page. Optional filters: search (name or country contains) and country (exact).
GET /api/v1/centres/{id} No One approved centre by its id.

A centre in the list

{
    "id": 1,
    "name": "...",
    "centre_name": "...",
    "email": "...",
    "phone": "...",
    "website": "...",
    "country": "...",
    "type": "...",
    "approval_number": "..."
}

Certificates and events

MethodEndpointSign-inWhat it returns
GET /api/v1/verify/{number} No Check a certificate by its number. Limit: 10 requests a minute.
GET /api/v1/events No Upcoming published events, soonest first, 20 a page.

Certificate found

{
    "success": true,
    "data": {
        "verified": true,
        "certificate_number": "...",
        "course_name": "...",
        "institute_name": "...",
        "issue_date": "...",
        "expiry_date": "...",
        "status": "..."
    }
}

A revoked certificate returns "verified": false with "status": "revoked" and the revocation date. A number that is not on record returns status 404:

{
    "success": false,
    "message": "Certificate not found",
    "data": { "verified": false }
}

Limits and status codes

Each user or IP address can make 60 requests a minute. Sign-in, registration and certificate checks have the lower limits shown above. Responses carry X-RateLimit-Limit and X-RateLimit-Remaining; a refused request also carries Retry-After, in seconds.

StatusMeaning
200Success
201Created (registration)
401The token is missing or not valid
404Not found
422The request did not pass validation, for example wrong sign-in details
429Too many requests

Checking one certificate?

You do not need the API for a single check. Enter the number on the verification page.