Endpoints
GET /api/user
Requires authorization
This will give you the user's details.
Example request
curl --request GET \
--url https://app.mylogin.com/api/user \
--header 'Authorization: Bearer {ACCESS_TOKEN}'
Response
{ "data": { "id": "A1161584171", "first_name": "Freya", "last_name": "Lee", "email": "Freya@mylogin.com", "type": "student", "last_online": "2023-08-16T13:02:58.000000Z", "service_providers": { "google": { "service_provider_id": "A987654321" }, "microsoft": null, "wonde": { "service_provider_id": "A123456789" }, }, "organisation": { "id": "A329362542", "wonde_id": "A1329183376", "name": "Furlong School", "phase_of_education": "16 Plus", "urn": 20, "la_code": "111", "establishment_number": "1222" } } }
The "service_providers" property is structured to consistently include all the service providers, specifically Google, Microsoft and Wonde. For each of these providers, the corresponding property ("google", "microsoft" and "wonde") will either return an array or null dependent upon if the user has been matched with the provider.
Name | Type | Description |
---|---|---|
id | string | Unique MyLogin identifier for this person. |
first_name | string | Unique MyLogin identifier for this person. |
last_name | string | Default last name of this person. |
string
nullable |
Default email address of this person. | |
type | string |
Any of:
|
last_online |
datetime
nullable |
UTC datetime for when this person last logged in using any login method. |
service_providers | array | An array containing data specific to matched user providers for this person. |
array
nullable |
An array containing data specific to matched Google user for this person.
Null when the organisation has not matched this person's MyLogin user to their Google account. |
|
service_provider_id | string | Google identifier for this person. |
microsoft |
array
nullable |
An array containing data specific to matched Microsoft user for this person.
null when the organisation has not matched this person's MyLogin user to their Microsoft account. |
service_provider_id | string | Microsoft identifier for this person. |
wonde |
array
nullable |
An array containing data specific to matched Wonde user for this person.
null when the organisation has not matched this person's MyLogin user to their Wonde account. |
service_provider_id | string | Wonde identifier for this person. Maps to the Wonde API's student/employee endpoint data.id field. |
organisation | array | An array containing data about the MyLogin organisation this person belongs to. |
id | string | Unique MyLogin identifier for this organisation. |
wonde_id |
string
nullable |
Wonde school identifier for this organisation. Maps to the Wonde API's schools endpoint data.id field.
null when this organisation has not connected to Wonde |
name | string | The name of the organisation. |
phase_of_education | string |
Any of:
|
urn |
int
nullable |
The URN (unique reference number) of the organisation. |
la_code |
string
nullable |
The LA (Local Authority) Code of the organisation. |
establishment_number |
string
nullable |
The Establishment Number of the organisation. |
MyLogin ↔ Wonde ID Mapping
The below table shows how the ID fields returned from the MyLogin /api/user
endpoint map to the ID fields returned on
the Wonde API.
MyLogin Endpoint | MyLogin Field | Wonde Endpoint | Wonde Field | |
---|---|---|---|---|
/api/user | data.id | N/A | N/A | |
/api/user | data.service_providers.wonde.service_provider_id | ↔ |
/schools/{school_id}/students /schools/{school_id}/students/{student_id} /schools/{school_id}/employees /schools/{school_id}/employees/{student_id} |
data.id |
/api/user | data.organisation.id | N/A | N/A | |
/api/user | data.organisation.wonde_id | ↔ |
/schools /schools/{school_id} |
data.id |