Skip to content

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:

PUT /<server_id>/persons/<pers_no>/memberships/<conf_no> HTTP/1.1

{
  "priority": 100,
  "where": 3
}

Response:

Success:

HTTP/1.1 201 Created

If the person or conference do not exist:

HTTP/1.1 404 NOT FOUND

Example:

curl -v -X PUT -H "Content-Type: application/json" -d { "priority": 100 } \
     "http://localhost:5001/lyskom/persons/14506/memberships/6"

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:

DELETE /<server_id>/persons/<pers_no>/memberships/<conf_no> HTTP/1.1

Response:

Success:

HTTP/1.1 204 OK

If the person or conference do not exist, or if the membership do not exist:

HTTP/1.1 404 NOT FOUND

Example:

curl -v -X DELETE "http://localhost:5001/lyskom/persons/14506/memberships/6"

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:

POST /<server_id>/persons/current/memberships/<conf_no>/unread HTTP/1.1

{
  "no_of_unread": 17
}

Response:

HTTP/1.1 204 OK

Example:

curl -v -X POST -H "Content-Type: application/json" \
     -d { "no_of_unread": 17 } \
     http://localhost:5001/lyskom/persons/current/memberships/14506/unread

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:

GET /<server_id>/persons/<pers_no>/memberships/<conf_no> HTTP/1.0

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:

HTTP/1.0 404 NOT FOUND

Example:

curl -v -X GET "http://localhost:5001/lyskom/persons/14506/memberships/14506"

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:

GET /<server_id>/persons/<pers_no>/memberships/<conf_no>/unread HTTP/1.0

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:

HTTP/1.0 404 NOT FOUND

Example:

curl -v -X GET "http://localhost:5001/lyskom/persons/14506/memberships/14506/unread"

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:

GET /<server_id>/persons/<pers_no>/memberships/ HTTP/1.1

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:

curl -v -X GET "http://localhost:5001/lyskom/persons/14506/memberships/?unread=true"

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:

GET /<server_id>/persons/<pers_no>/memberships/unread/ HTTP/1.1

Response:

HTTP/1.1 200 OK

{
  "list": [
    {
      "pers_no": <pers_no>,
      "conf_no": <conf_no>,
      "no_of_unread": 2,
      "unread_texts": [
        19831603,
        19831620
      ]
    },
    ...
  ]
}

Example:

curl -v -X GET "http://localhost:5001/lyskom/persons/14506/memberships/unread/"