This shows usage of the Local Connect API.
- The client sends a request to the server with
application/www-form-urlencoded
type. The requests have parameters and headers according to theHTTP/1.1
protocol. - After the server proceeded the request, the server returns responses to the client with
application/json
type. For details, see theRFC4627
standard.
http://www.ietf.org/rfc/rfc4627
- When the server failed to proceed the request, it returns an error with the
Error
object. For details, see the specification of the object below.
Code | HTTP Status | Description |
---|---|---|
NOT_AUTHORIZED |
401 | When no session provided or the provided session is invalid. |
ENDPOINT_NOT_FOUND |
404 | When the specified API endpoint is not found. |
TOKEN_NOT_FOUND |
404 | When the provided token is invalid or expired. |
USER_NOT_FOUND |
404 | When the user of the specified UUID is not found. |
- The user logs into the system with its token (may be as a QR code). At this time, the server provides a session to the client. Hereinafter, this is called authentification (authentificating).
- After the user logged in, when the client uses the API, the client creates a request with
X-LocalConnect-Session
header includes the session. At this time, the client gets restrictive permission (not permanently). Hereinafter, this is called authorization (authorizing).
- If the user wants to read/write (object of) users or of another groups , it also need read/write_groups permission .
- If the user wants to read/write (object of) users or groups of another regions , it also need read/write_regions permission .
Permission | Description |
---|---|
read_permissions | Whether the user can read permissions. |
read_types | Whether the user can read user types. |
read_regions | Whether the user can read regions. |
read_groups | Whether the user can read groups. |
read_users | Whether the user can read users. |
read_documents | Whether the user can read documents. |
read_boards | Whether the user can read boards. |
read_events | Whether the user can read events. |
read_posts | Whether the user can read posts. |
read_profiles | Whether the user can read profiles. |
read_images | Whether the user can read images. |
write_types | Whether the user can create or edit user types. |
write_regions | Whether the user can create or edit regions. |
write_groups | Whether the user can create or edit groups. |
write_documents | Whether the user can create or edit documents. |
write_users | Whether the user can create or edit users. |
write_boards | Whether the user can create or edit boards. |
write_events | Whether the user can create or edit events. |
write_posts | Whether the user can post. |
write_profiles | Whether the user can edit profiles. |
write_images | Whether the user can upload images. |
write_service | Whether the user can edit service summary. |
This shows the definition and the range of each types of values.
Type | Range | Description |
---|---|---|
bool | 0 - 1 | A boolean value. Also can be showed as true or false . |
uint | 0 - 4,294,967,295 | A unsigned 32-bit numeric value. |
ulong | 0 - 18,446,744,073,709,551,615 | A unsigned 64-bit numeric value. |
string | N/A | A string value that contains chars of Unicode. |
The object shows a thing with member values. Objects can be Types in JSON.
This shows an error.
Member | Type | Description |
---|---|---|
error | string | An error code. |
This shows a permission. it is a read-only object.
Member | Type | Description |
---|---|---|
id | string | An UUID of the permission. |
name | string | A name of the permission. |
This shows a type of users.
Member | Type | Description |
---|---|---|
id | string | An UUID of the type. |
name | string | A name of the type. (Max. 255 chars) |
permissions | Permission[] | An array of permissions that the user has. |
created_at | ulong | A UNIX timestamp when the type created. |
This shows a region that has groups.
Member | Type | Description |
---|---|---|
id | An UUID of the region. | |
name | A name of the region. (Max. 255 chars) | |
created_at | ulong | A UNIX timestamp when the region created. |
This shows a group in a region that has users.
Member | Type | Description |
---|---|---|
id | An UUID of the group. | |
region | Region | A region that the group is in. |
name | A name of the group. (Max. 255 chars) | |
description | Detail of the group. (Max. 100K chars) | |
created_at | ulong | A UNIX timestamp when the group created. |
This shows a user.
Member | Type | Description |
---|---|---|
id | string | A unique identifier (hereinafter, this is called an UUID) of the user. |
name | string | A name of the user. (Max. 255 chars) |
type | UserType | The type of the user. |
group | Group | The group that the user belongs to. |
avatar | Image? | Nullable. The avatar of the user. |
created_at | ulong | A UNIX timestamp when the user created. |
This shows a created user.
This inherits User
object .
Member | Type | Description |
---|---|---|
token | string | A token of the created user. |
This shows a session.
Member | Type | Description |
---|---|---|
id | string | An UUID of the user. |
user | User | A user that has the session. |
created_at | ulong | A UNIX timestamp when the session created. |
This shows a created session.
This inherits Session
object .
Member | Type | Description |
---|---|---|
secret | string | A secret of the created session. |
This shows a universal documentation.
Member | Type | Description |
---|---|---|
id | string | An UUID of the document. |
author | User | A user who created the document. |
title | string | Title of the document. (Max. 512 chars) |
content | string | Content of the document. |
attachments | Attachment[] | An array of attachments of the document. |
created_at | ulong | A UNIX timestamp when the document created. |
This shows an attachment of a document.
Member | Type | Description |
---|---|---|
id | string | An UUID of the attachment. |
type | string | The type of the object. |
object | object (any) | An object attached to the document. |
This shows a bulletin board.
Member | Type | Description |
---|---|---|
id | string | An UUID for the board. |
group | Group | A group that the board provided in. |
documents | Document[] | Array of documents in the board. |
created_at | ulong | A UNIX timestamp when the board created. |
This shows a user-read mark of a board.
Member | Type | Description |
---|---|---|
id | string | An UUID of the mark. |
user | User | A user who read the board. |
board | Board | A board that the user read. |
created_at | ulong | A UNIX timestamp when the user read the board. |
This shows a event.
Member | Type | Description |
---|---|---|
id | string | An UUID of the event. |
author | User | A user who created the event. |
document | Document | A document that is described the event. |
date | ulong | A UNIX timestamp when the event will start. |
attendances | EventAttendance[] | An array of attendnaces of the event. |
created_at | ulong | A UNIX timestamp when the event created. |
This shows a attendance of a event and a user.
Member | Type | Description |
---|---|---|
id | string | An UUID of the attendance. |
user | User | A user of the attendee. |
created_at | ulong | A UNIX timestamp when the attendee decided to join. |
This shows a user post.
Member | Type | Description |
---|---|---|
id | string | An UUID of the post. |
author | User | A user who posted. |
document | Document | A document of the content of the post. |
likes | PostLike[] | An array of like reactions of the post. |
created_at | ulong | A UNIX timestamp when the post created. |
This shows a "Like!" reaction of a post.
Member | Type | Description |
---|---|---|
id | string | An UUID of the reaction. |
user | User | A user who liked. |
created_at | ulong | A UNIX timestamp when the user liked the post. |
This shows a profile of a user.
Member | Type | Description |
---|---|---|
id | string | An UUID of the user. |
user | User | A user that has the profile. |
hobbies | string | Hobbies of the user. (Max. 512 chars) |
favorites | string | Favorite things of the user. (Max. 512 chars) |
mottoes | string | Mottoes of the user. (Max. 512 chars) |
updated_at | ulong | A UNIX timestamp when the profile last updated. |
This shows an image.
Member | Type | Description |
---|---|---|
id | An UUID of the image. | |
owner | User | A user who uploaded the image. |
created_at | ulong | A UNIX timestamp when the image created. |
This shows the service summary.
Member | Type | Description |
---|---|---|
description | string | Detail of the service. (Max. 100K chars) |
This provides a permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the permission to show. |
This returns a Permission
object.
This provides a list of permissions.
This needs no parameters.
This returns an array of Permissions
objects.
This provides a user type. This requires read_types permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the type to show. |
This returns a UserType
object.
This provides a list of user types. This requires read_types permission.
This needs no parameters.
This returns an array of UserType
objects.
This creates or edits a user type. This requires write_types permission.
Parameter | Type | Description |
---|---|---|
id | string | Optional. If this is provided, the user can edit the type. |
permissions | string (comma-separated array) | Permissions that the user of the type has. |
This returns the UserType
object that the user created or edited.
This provides a region. This requires read_regions permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the region to show. |
This returns a Region
object.
This provides a list of regions. This requires read_regions permission.
This needs no parameters.
This returns an array of Region
objects.
This creates or edits a region. This requires write_regions permission.
Parameter | Type | Description |
---|---|---|
id | string | Optional. If this is provided, the user can edit the region. |
name | string | A name of the region. |
description | string | Detail of the group. (Max. 100K chars) |
This returns a Region
object that the use created or edited.
This provides a group. This requires read_groups permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the group to show. |
This returns a Group
object.
This provides a list of groups in a region. This requires read_groups permission.
Parameter | Type | Description |
---|---|---|
region | string | Optional. The UUID of the region to list groups. (Default: the region of current user) |
This returns an array of Group
objects.
This creates or edits a group. This requires write_groups permission.
Parameter | Type | Description |
---|---|---|
id | string | Optional. If this is provided, the user can edit the group. |
region | string | The UUID of the region that the group belongs to. |
name | string | A name of the group. |
description | string | Detail of the group. (Max. 100K chars) |
This returns the Group
object that the user created or edited.
This provides who is the authorized user with the current session.
This needs no parameters.
This returns an User
object of the current user.
This provides a user. This requires read_users permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the user to show. |
This returns an User
object.
This provides a list of users in a group. This requires read_users permission.
Parameter | Type | Description |
---|---|---|
group | string | Optional. The UUID of the group to list users. (Default: the group of current user) |
This returns an array of User
objects.
This creates or edits a user. This requires write_users permission.
Parameter | Type | Description |
---|---|---|
id | string | Optional. If this is provided, it can edit the user. |
group | string | The UUID of the group that the user belongs to. |
type | string | The UUID of the user type. |
name | string | The name of the user. |
This returns the CreatedUser
object that the user created or edited.
This sets the avatar of the user. This requires write_users permission when setting other user's one.
Parameter | Type | Description |
---|---|---|
user | string | Optional. The UUID of the user. (Default: current user) |
avatar | string | The UUID of the image to set. |
This returns the User
object with the avatar.
This provides the current session.
This needs no parameters.
This returns the Session
object of the current session with 200 OK
status.
This creates a session from the token. This doesn't need to authorize .
Parameter | Type | Description |
---|---|---|
token | string | A token to create the session. |
This returns the created CreatedSession
object with 200 OK
status.
This destroys the session.
This needs no parameters.
This returns only 204 No Content
status.
This provides a document. This requires read_documents permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the document to show. |
This returns an Document
object.
This provides a list of documents of a user. This requires read_documents permission.
Parameter | Type | Description |
---|---|---|
user | string | Optional. The UUID of the user to list documents. (Default: current user) |
until | string | Optional. The oldest document that it returns. |
since | string | Optional. The latest document that it returns. |
This returns an array of Document
objects. (Descending to latest one)
The array contains 100 objects max.
If the objects between until
and since
are over maximum of the array, it returns from latest.
This creates or edits a document. This requires write_documents permission.
Parameter | Type | Description |
---|---|---|
id | string | Optional. If this is provided, the user can edit the document. |
title | string | A title of the document. |
content | string | A content of the document. |
attachments | string (comma-separated array) | Optional. An array of attachments to attach to the document. |
This returns the Document
object that the user created or edited.
This provides a board. This requires read_boards permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the board to show. |
This returns an Board
object.
This provides who read the board. This requires read_boards permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the board to show read marks. |
This returns an array of BoardRead
objects.
This provides a list of boards of a group. This requires read_boards permission.
Parameter | Type | Description |
---|---|---|
group | string | Optional. The UUID of the group to list boards. (Default: current group) |
until | string | Optional. The oldest document that it returns. |
since | string | Optional. The latest document that it returns. |
This returns an array of Board
objects.
The array contains 100 objects max.
If the objects between until
and since
are over maximum of the array, it returns from latest.
This mark a board read. This requires read_boards permission.
Parameter | Type | Description |
---|---|---|
board | string | The UUID of the board to mark. |
This returns a BoardRead
object that the user marked.
This creates or edits a board. This requires write_boards permission.
Parameter | Type | Description |
---|---|---|
id | string | Optional. If this is provided, the user can edit the board. |
documents | string (comma-separated array) | UUIDs of documents that the board has. |
This returns the Board
object that the user created or edited.
This provides a event. This requires read_events permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the event to show. |
This returns an Event
object.
This provides a list of events that a user hold. This requires read_events permission.
Parameter | Type | Description |
---|---|---|
user | string | Optional. The UUID of the user to list events. (Default: current user) |
until | string | Optional. The oldest document that it returns. |
since | string | Optional. The latest document that it returns. |
This returns an array of Event
objects.
The array contains 100 objects max.
If the objects between until
and since
are over maximum of the array, it returns from latest.
This provides a list of events that the user joined. This requires read_events permission.
Parameter | Type | Description |
---|---|---|
user | string | Optional. The UUID of the user to list joined events. (Default: current user) |
until | string | Optional. The oldest document that it returns. |
since | string | Optional. The latest document that it returns. |
This returns an array of Event
objects.
The array contains 100 objects max.
If the objects between until
and since
are over maximum of the array, it returns from latest.
This provides a list of events of a group. This requires read_events permission.
Parameter | Type | Description |
---|---|---|
group | string | Optional. The UUID of the group to list events. (Default: the group of current user) |
until | string | Optional. The oldest document that it returns. |
since | string | Optional. The latest document that it returns. |
This returns an array of Event
objects.
The array contains 100 objects max.
If the objects between until
and since
are over maximum of the array, it returns from latest.
This creates attendance of a event and a user. This requires read_events permission.
Parameter | Type | Description |
---|---|---|
event | string | The UUID of the event to mark. |
This returns the EventAttendance
object.
This creates or edits a event. This requires write_events permission.
Parameter | Type | Description |
---|---|---|
id | string | Optional. If this is provided, the user can edit the event. |
document | string | The UUID of the document that is explained the event. |
date | ulong | A UNIX timestamp when the event will start. |
This returns the Event
object that the user created or edited.
This provides a post. This requires read_posts permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the post to show. |
This returns an Post
object.
This provides a list of posts of a user. This requires read_posts permission.
Parameter | Type | Description |
---|---|---|
user | string | Optional. The UUID of the user to list posts. (Default: current user) |
until | string | Optional. The oldest document that it returns. |
since | string | Optional. The latest document that it returns. |
This returns an array of Post
objects.
The array contains 100 objects max.
If the objects between until
and since
are over maximum of the array, it returns from latest.
This provides a list of posts of a user. This requires read_posts permission.
Parameter | Type | Description |
---|---|---|
group | string | Optional. The UUID of the group to list posts. (Default: current group) |
until | string | Optional. The oldest document that it returns. |
since | string | Optional. The latest document that it returns. |
This returns an array of Post
objects.
The array contains 100 objects max.
If the objects between until
and since
are over maximum of the array, it returns from latest.
This likes a post. This requires read_posts permission.
Parameter | Type | Description |
---|---|---|
post | string | The UUID of the post to like. |
This returns a PostLike
object that the user reacted.
This creates or edits a post. This requires write_posts permission.
Parameter | Type | Description |
---|---|---|
id | string | Optional. If this is provided, the user can edit the post. |
document | string | The UUID of the document of the post. |
This returns the Post
object that the user created or edited.
This provides a profile of the user who has the current session.
This needs no parameters.
This returns an Profile
object of the profile of the current user.
This provides a profile. This requires read_profiles permission.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the profile to show. |
This returns an Profile
object.
This provides a profile of a user. This requires read_profiles permission.
Parameter | Type | Description |
---|---|---|
user | string | The UUID of the user to show the profile. |
This returns an Profile
object.
This creates or edits a profile of the current user. This requires write_posts permission.
Parameter | Type | Description |
---|---|---|
hobbies | string | Hobbies of the user. (Max. 512 chars) |
favorites | string | Favorite things of the user. (Max. 512 chars) |
mottoes | string | Mottoes of the user. (Max. 512 chars) |
This returns the Profile
object that the user created or edited.
This provides a image. This requires read_images permission. This doesn't return JSON data.
Parameter | Type | Description |
---|---|---|
id | string | The UUID of the image to show. |
This returns image binary data.
This creates a image from the uploaded file. This requires write_images permission.
This requires image binary data to upload in the request body.
This returns the Image
object that the user created.
This creates a attachment from specified object. This requires write_documents permission. If the attachments that has same object exists, the system can recycle the attachment.
Parameter | Type | Description |
---|---|---|
type | string | The type of the object to attach. (e.g. 'Image' or 'Event') |
object_id | string | The UUID of the object to attach. |
This returns the Attachment
object that the user created.
This provides the service summary. This doesn't need to authorize .
This needs no parameters.
This returns the Service
object.
This edits the service summary. This requires write_service permission.
Parameter | Type | Description |
---|---|---|
description | string | Detail of the service. (Max. 100K chars) |