JodaCare API

Welcome to JodaCare API documentation.

The first part of this documentation contains information about our objects and how they work together. This is important to read first because the objects can be combined in multiple ways.

The second part is a description of the endpoints and how they are used.

User

Attributes Description
url The url
id The id
calendar The url to the user's calendar
userprofile The userprofile of this user (See UserProfile for details)
settings The url to the user's settings
userinfo_set An array of urls to this user's user-info objects
relation_set An array of urls to this user's relations
primary_contacts An array of urls to this user's primary contacts
closest_relatives An array of urls to this user's closest relatives
service_receivers An array of urls to this user's service receivers
last_login When the user last was logged in
is_superuser Whether the user is a superuser
email The email address
first_name The first name
last_name The last name
is_staff Whether the user is a staff member (can log into the admin panel)
is_employee Whether the user is an employee
is_active Whether the user is active
is_service_receiver Whether the user is a service receiver
created When it was created
updated When it was updated
stripe_customer_id The Stripe customer id
institutions A list of urls to the institutions this user is a member of
functional_groups A list of urls to the functional groups this user is a member of

UserProfile

Attributes Description
url The url
image The profile image of this user
thumbnails Thumbnails of the profile image
description A description of this user
job_title The job title. Used if the user is an employee
date_of_birth The date of birth. Used primarily for service receivers
cell_phone_number The cell phone number
safety_system The safety system. Used for service receivers who have GPS trackers
created When it was created
updated When it was updated
user The url to user this profile belongs to
address The user's address (See Address for more info)

Calendar

Attributes Description
url The url
events A list of recent calendar events
user The url of the user this calendar belongs to
name The name of the calendar (set to the user's email address on creation)

Events

An event is a single event in a user's calendar. Ex. a doctor's appointment.

Events can also be repeated (recurring). Ex. a dancing class. Event occurrences will be generated based on the rule.

Attributes Description
url The url
rule The rule of how the event occurs (See Rule) ONLY SET ON RECURRING EVENTS
occurrences The occurrences of the event (See Occurrence)
entries A list of GenericText objects which has this event as its content_object
images A list of GenericImage objects which has this event as its content_object
start start date and time (ISO)
end end date and time (ISO)
title The title
description The description
end_recurring_period The date the recurring event will stop
color_event HEX color
creator Url of the user which has created the event
calendar Url of the calendar this event belongs to

Occurrence

If an event is recurring, it has occurrences. Occurrences are generated dynamically on request unless they have been saved. We have to save an occurrence if we cancel it, add comments (GenericText) or images (GenericImage) or change the date and time of the occurrence.

Attributes Description
url The url
entries A list of GenericText objects which has this event as its content_object
images A list of GenericImage objects which has this event as its content_object
cancelled_by The url of the user who has cancelled the occurrence
start start date and time (ISO)
end end date and time (ISO)
title The title
description The description
cancelled Whether the occurrence is cancelled,
original_start The original start date and time (ISO)
original_end The original end date and time (ISO)
created_on Date and time of creation
updated_on Date and time when it was updated
event Url of the event this occurrence belongs to

Rule

A rule determines how a recurring event occurs. Occurrences are calculated based on a rule.

Attributes Description
url The url
name The name
description The description
frequency The frequence
params A string of parameters separated by semicolon

Frequencies: DAILY, WEEKLY, MONTHLY, YEARLY

Weekday params: 0-6 (Mon - Sun)

Hour params: 00-23

Every day at 9, 14 and 18

{
  "frequency": "DAILY",
  "params": "byhour:09,14,18"
}

Every Monday and Thursday

{
  "frequency": "WEEKLY",
  "params": "byweekday:0,3"
}

FunctionalGroup

A functional group is essentialy a group any user can be a member of. It can belong to either an Institution or an Event.

Attributes Description
url The url
content_object The url to the Instition or Event it belongs to
members A list of its members urls
groupinfo_set A list of urls to its group-info
name The name
created Date and time of creation
updated Date and time when it was updated

Institution

An Institution is typically a nursing home or a hospital, or a department. Institutions can have parents and/or children.

Attributes Description
url The url
users A list of users belonging to the institution
children A list of child institutions
name The name
phone_number The phone number
cell_phone_number The cell phone number
created Date and time of creation
updated Date and time when it was updated
parent Url to the parent institution
contact Url of the user listed as contact
address Url to the Address
employees A list of url to the employees

UserInfo

UserInfo works as a container for GenericText objects.

Attributes Description
url The url
entries A list of recent entries (GenericText)
user Url to the user it belongs to
description The description. messages , feed or moderated
created Date and time of creation
updated Date and time when it was updated

GroupInfo

GroupInfo works as a container for GenericText objects.

Attributes Description
url The url
entries A list of recent entries (GenericText)
description The description. messages , feed or moderated
created Date and time of creation
updated Date and time when it was updated
group Url to the functional group it belongs to

GenericText

Both messages and entries are generic-text objects, but with some differences in which attributes that should be populated.

Attributes Description
url The url
content_object The url to the user- or group-info this entry is attached to
type The type of the content_object
children Other generic-text which has this generic-text as its content_object
created_by The user who has created the object
content_object_detail Details about the user/functional-group the content_object of this generic-text is published to
text The text of the object
priority MESSAGES ONLY The priority
created When it was created
updated When it was updated
read_by MESSAGES ONLY An array of urls to users who have read this entry
liked_by ENTRIES ONLY An array of urls to users who have cared about this entry

GenericImage

Attributes Description
url The url
content_object The url to the user- or group-info this entry is attached to
type The type of the content_object
image Url to the original image
mimetype The mimetype
thumbnails A list of thumbnails

size: The size created | Date and time of creation updated | Date and time when it was updated created_by | Url to the creator

RelationTypes

A user can have many relations, and different type of relations have different access rules.

Attributes Description
url The url
name The name
description The description
created Date and time of creation
updated Date and time when it was updated

Relations

Attributes Description
url The url
relation_type The relation type
description The description. Ex. Son, Daughter
created Date and time of creation
updated Date and time when it was updated
user Url to the service receiver
grantee Url to the user with grantee permissions on the service receiver

Invitation

Attributes Description
url The url,
recipient The email address of the recipient,
is_active Whether it is active or not
inviter The url of the inviter
relation_to The url to the service receiver
relation_type The url to the relation type

Authenticate a user

Property Description
email (required) the user's email address
password (required) the user's password
POST
https://api.jodacare.no/api/token-auth/

Example request body

{
  "email": "{email}",
  "password": "{password}"
}

Example response

{
    "token": "{token}"
}

Refresh a token

Property Description
token (required) the user's token
POST
https://api.jodacare.no/api/token-refresh/

Example request body

{
  "token": "{token}"
}

Example response

{
    "token": "{token}"
}

Verify a token

Property Description
token (required) the user's token
POST
https://api.jodacare.no/api/token-verify/

Example request body

{
  "token": "{token}"
}

Example response

{
    "token": "{token}"
}

Set new password

Property Description
password (required) the new password
PATCH
https://api.jodacare.no/api/v2/account/users/{id}/set-password/

Example request body

{
  "password": "{password}"
}

Register a new user

This registeres a new user and returns a token. The token can be stored locally and used for authenticated requests.

Property Description
email (required) the user's email address
password (required) the user's password
POST
https://api.jodacare.no/api/v2/register/

Example request body

{
  "email": "{email}",
  "password": "{password}"
}

Example response

{
    "url": "{url}",
    "token": "{token}"
}

Get calendar occurrences

Entries are published to the service receiver or functional group's book. An entry is a generic-text object with a user- or group-info as it's content_object.

Get all entries

Returns entries from all users and functional groups the authenticated user has access to. Typically used to generate a feed of recent entries.

Query params Description
limit (optional) The pagination limit
offset (optional) The pagination offset
GET
https://api.jodacare.no/api/generic-text/detailed/?description=feed

Get entries for a specific service receiver

To get a service receiver's feed you need to send two requests. First, you need the url to the service receiver's user-info for feed. The second request is where you fetch the entries.

Get a service receiver's user-info for feed

Parameters Description
id (required) The id of the service receiver
GET
https://api.jodacare.no/api/user-info/?description=feed&user_id={id}

Get a service receiver's feed entries

Parameters Description
id (required) The id of the user-info
GET
https://api.jodacare.no/api/v2/user-info/{id}/entries/

Get entries for a specific functional group

To get a functional groups's feed you need to send two requests. First, you need the url to the functional group's group-info for feed. The second request is where you fetch the entries.

Get a functional groups's group-info for feed

Parameters Description
id (required) The id of the functional group
GET
https://api.jodacare.no/api/group-info/?description=feed&group_id={id}

Get a functional group's feed entries

Parameters Description
id (required) The id of the group-info
GET
https://api.jodacare.no/api/v2/group-info/{id}/entries/

Get all messages

Returns messages from all users and functional groups the authenticated user has access to. Typically used to generate a feed of recent messages.

Query params Description
limit (optional) The pagination limit
offset (optional) The pagination offset
GET
https://api.jodacare.no/api/generic-text/detailed/?description=messages

Get messages for a specific service receiver

To get a service receiver's messages you need to send two requests. First, you need the url to the service receiver's user-info for messages. The second request is where you fetch the messages.

Get a service receiver's user-info for messages

Parameters Description
id (required) The id of the service receiver
GET
https://api.jodacare.no/api/user-info/?description=messages&user_id={id}

Get a service receiver's messages

Parameters Description
id (required) The id of the user-info
GET
https://api.jodacare.no/api/v2/user-info/{id}/entries/

Get messages for a specific functional group

To get a functional group's messages you need to send two requests. First, you need the url to the functional group's group-info for messages. The second request is where you fetch the messages.

Get a functional group's group-info for messages

Parameters Description
id (required) The id of the functional group
GET
https://api.jodacare.no/api/group-info/?description=messages&group_id={id}

Get a functional group's messages

Parameters Description
id (required) The id of the group-info
GET
https://api.jodacare.no/api/v2/group-info/{id}/entries/

Get all users

Query params Description
is_active (optional) Show only active users
is_employee (optional) Show only employees
is_service_receiver (optional) Show only service receivers
limit (optional) The pagination limit
offset (optional) The pagination offset
GET
https://api.jodacare.no/api/account/users/

Get employees

GET
https://api.jodacare.no/api/account/users/?is_active=true&is_employees=true

Get service receivers

GET
https://api.jodacare.no/api/account/users/?is_active=true&is_service_receiver=true

Get relatives

GET
https://api.jodacare.no/api/account/users/?is_active=true&is_service_receiver=false&is_employee=false

Get a user by its id

GET
https://api.jodacare.no/api/account/users/{id}/

Update a user

Attributes Description
url The url
userprofile The userprofile of this user (See UserProfile for details)
last_login When the user last was logged in
is_superuser Whether the user is a superuser
email The email address
first_name The first name
last_name The last name
is_staff Whether the user is a staff member (can log into the admin panel)
is_employee Whether the user is an employee
is_active Whether the user is active
is_service_receiver Whether the user is a service receiver
PATCH
https://api.jodacare.no/api/account/users/{id}/

Register a user

Attributes Description
email The email
password The password
POST
https://api.jodacare.no/api/account/users/register

Create a service receiver

Attributes Description
first_name The first name
last_name The last name
email The email
password The password
POST
https://api.jodacare.no/api/account/users/create-service-receiver

Get all relations

GET
https://api.jodacare.no/api/relations/

Get a user's relations

GET
https://api.jodacare.no/api/users/{id}/user-relations

Get all institutions

GET
https://api.jodacare.no/api/institutions

Get a institution by its id

GET
https://api.jodacare.no/api/institutions/{id}

Get all functional groups

GET
https://api.jodacare.no/api/functional-groups

Get a functional group by its id

GET
https://api.jodacare.no/api/functional-groups/{id}
Show examples in:
JodaCare API Documentation