User management
First things first, OneOffice is designed to be multi-tenant. Each tenant is an 'instance' (we should have called it 'tenant' but it was ambiguous).
The instance is automatically identified server-side by the URL of the instance.
The security sandbox of OneOffice does not allow a session of one instance to access the data of another instance.
So each user will have a field called instance which will define their instance id (which is numeric). For example, here is a sample user:
{
"id": "1",
"instance": 1,
"email": "user@test.oneoffice.ca",
"avatar": "",
"groups": [],
"settings": [
84,
213,
10,
92
],
"apps": [
0,
0,
0
],
"values": {
"timezone": null,
"editorTemplates": null,
"notificationReminder": 3
},
"profile": {
"uid": null,
"grade": null,
"title": null,
"phones": [],
"location": null,
"department": null
},
"displayName": "Demo User",
"isActive": true,
"isAdmin": true,
"isSysAdmin": false,
"rootFiles": 1,
"trashFiles": 2,
"inbox": 1,
"spam": 2,
"sent": 3,
"trashEmail": 4,
"drafts": 6,
"mainCalendar": 1,
"token": "1IGCKs8Upvg6LEzQgBwqc9PHQZCU5Lrv1UBAfRPv",
"tokenExpiresAt": 1685932472,
"isPartner": false
}
In the case of a custom client, you are likely to have a unique instance id linked to your application.