Memberships

httpkom.memberships.persons_delete_membership(pers_no, conf_no)

Remove the person’s membership in the given conference.

Parameters
  • pers_no (int) – Person number

  • conf_no (int) – Conference number

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"
httpkom.memberships.persons_get_membership(pers_no, conf_no)

Get a person’s membership for a conference.

Parameters
  • pers_no (int) – Person number

  • conf_no (int) – Conference number

Request

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

Responses

HTTP/1.0 200 OK

{
  "pers_no": <pers_no>,
  "conference": {
    "conf_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"
httpkom.memberships.persons_get_membership_unread(pers_no, conf_no)

Get membershup unread for a person’s membership.

Parameters
  • pers_no (int) – Person number

  • conf_no (int) – Conference number

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"
httpkom.memberships.persons_list_membership_unreads(pers_no)

Get list of membership unreads for a person’s memberships.

Parameters

pers_no (int) – Person number

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/"
httpkom.memberships.persons_list_memberships(pers_no)

Get list of a person’s memberships.

Parameters

pers_no (int) – Person number

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": {
        "conf_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"
httpkom.memberships.persons_put_membership(pers_no, conf_no)

Add the person as member to the given conference, or update an existing membership.

Parameters
  • pers_no (int) – Person number

  • conf_no (int) – Conference number

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"
httpkom.memberships.persons_set_unread(conf_no)

Set number of unread texts in current person’s membership for the given conference.

Parameters

conf_no (int) – Conference number

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