Memberships¶
httpkom.memberships
¶
persons_put_membership(pers_no, conf_no)
async
¶
Add the person as member to the given conference, or update an existing membership.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pers_no
|
int
|
Person number. |
required |
conf_no
|
int
|
Conference number. |
required |
Optional parameters in the body:
| Key | Type | Values |
|---|---|---|
| priority | integer | (Default 100) The priority of the membership. |
| where | integer | (Default 0) The position in the membership list. |
Request:
Response:
Success:
If the person or conference do not exist:
Example:
persons_delete_membership(pers_no, conf_no)
async
¶
Remove the person's membership in the given conference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pers_no
|
int
|
Person number. |
required |
conf_no
|
int
|
Conference number. |
required |
Request:
Response:
Success:
If the person or conference do not exist, or if the membership do not exist:
Example:
persons_set_unread(conf_no)
async
¶
Set number of unread texts in current person's membership for the given conference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conf_no
|
int
|
Conference number. |
required |
Request:
Response:
Example:
persons_get_membership(pers_no, conf_no)
async
¶
Get a person's membership for a conference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pers_no
|
int
|
Person number. |
required |
conf_no
|
int
|
Conference number. |
required |
Request:
Responses:
HTTP/1.0 200 OK
{
"pers_no": <pers_no>,
"conference": {
"name": "Oskars Testperson",
"conf_no": <conf_no>
},
"priority": 255,
"added_at": "2013-11-30T15:58:06Z",
"position": 3,
"type": {
"passive": 0,
"secret": 0,
"passive_message_invert": 0,
"invitation": 0
},
"last_time_read": "2013-11-30T15:58:06Z",
"added_by": {
"pers_no": 14506,
"pers_name": "Oskars Testperson"
}
}
Not a member:
Example:
persons_get_membership_unread(pers_no, conf_no)
async
¶
Get membership unread for a person's membership.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pers_no
|
int
|
Person number. |
required |
conf_no
|
int
|
Conference number. |
required |
Request:
Responses:
HTTP/1.0 200 OK
{
"pers_no": <pers_no>,
"conf_no": <conf_no>,
"no_of_unread": 2,
"unread_texts": [
19831603,
19831620
]
}
Not a member:
Example:
persons_list_memberships(pers_no)
async
¶
Get list of a person's memberships.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pers_no
|
int
|
Person number. |
required |
Query parameters:
| Key | Type | Values |
|---|---|---|
| unread | boolean | true: Return memberships with unread texts in. The protocol A spec says: "The result is guaranteed to include all conferences where pers-no has unread texts. It may also return some extra conferences. Passive memberships are never returned." See persons_list_membership_unreads() if you want the exact list of conferences with unread. false (Default): Return all memberships. |
| passive | boolean | true: Include passive memberships. false (Default): Do not include passive memberships. |
| first | integer | The first position in the membership list to retrieve, numbered from 0 and up. Not possible with unread=true. Default: 0. |
| no-of-memberships | integer | The number of memberships to retrieve. Not possible with unread=true. Default: 100. |
Request:
Response:
HTTP/1.1 200 OK
{
"has_more": true,
"memberships": [
{
"pers_no": <pers_no>,
"conference": {
"name": "Oskars Testperson",
"conf_no": 14506
},
"priority": 255,
"added_at": "2013-11-30T15:58:06Z",
"position": 3,
"type": {
"passive": 0,
"secret": 0,
"passive_message_invert": 0,
"invitation": 0
},
"last_time_read": "2013-11-30T15:58:06Z",
"added_by": {
"pers_no": 14506,
"pers_name": "Oskars Testperson"
},
"no_of_unread": null,
"unread_texts": null
},
...
]
}
Example:
persons_list_membership_unreads(pers_no)
async
¶
Get list of membership unreads for a person's memberships.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pers_no
|
int
|
Person number. |
required |
Request:
Response:
HTTP/1.1 200 OK
{
"list": [
{
"pers_no": <pers_no>,
"conf_no": <conf_no>,
"no_of_unread": 2,
"unread_texts": [
19831603,
19831620
]
},
...
]
}
Example: