API Documentation

Delegations /api/delegations

Get a list of all delegations around you

Get a list of delegations that have affected you.

GET /api/delegations

Example output

[
   {
      "pending?" : true,
      "delegatable" : {
         "name" : "Test",
         "id" : 42,
         "type" : "Activity",
         "description" : ""
      },
      "note" : {
         "body" : null
      },
      "to_user" : {
         "user_since" : "2013-08-21T13:19:19Z",
         "email" : "info@organisedminds.com",
         "avatar" : {
            "thumb_url" : "https://app.organisedminds.com/assets/app/no-profile.jpg",
            "url" : "https://app.organisedminds.com/assets/app/no-profile.jpg"
         },
         "id" : "a98542857",
         "name_or_email" : "Tester The Great",
         "last_name" : "The Great",
         "first_name" : "Tester"
      },
      "created_at" : "2013-09-25T13:41:12Z",
      "accepted?" : false,
      "active?" : true,
      "id" : 21,
      "declined?" : false,
      "from_user" : {
         "user_since" : "2013-08-22T09:32:09Z",
         "email" : "john@doe.com",
         "avatar" : {
            "thumb_url" : "https://app.organisedminds.com/storage/avatars/33be4fa8d6a1d2b1337f68db208ab6b9/thumb/zedd2.png",
            "url" : "https://app.organisedminds.com/storage/avatars/33be4fa8d6a1d2b1337f68db208ab6b9/original/zedd2.png"
         },
         "id" : "116fa15bdab0",
         "name_or_email" : "John Doe",
         "last_name" : "Doe",
         "first_name" : "John"
      }
   },
   // ...
]

Get a single delegation

GET /api/delegations/:id

Example output

{
   "id" : 20,
   "pending?" : false,
   "active?" : true,
   "accepted?" : true,
   "declined?" : false,
   "created_at" : "2013-09-25T12:47:38Z",
   "delegatable" : {
      "name" : "Test",
      "id" : 41,
      "type" : "Activity",
      "description" : ""
   },
   "note" : {
      "body" : "<p>\r\n\tTest\r\n</p>"
   },
   "to_user" : {
      "user_since" : "2013-08-22T09:32:09Z",
      "email" : "john@doe.com",
      "avatar" : {
         "thumb_url" : "https://app.organisedminds.com/storage/avatars/33be4fa8d6a1d2b1337f68db208ab6b9/thumb/zedd2.png",
         "url" : "https://app.organisedminds.com/storage/avatars/33be4fa8d6a1d2b1337f68db208ab6b9/original/zedd2.png"
      },
      "id" : "116fa15bdab0",
      "name_or_email" : "John Doe",
      "last_name" : "Doe",
      "first_name" : "John"
   },
   "from_user" : {
      "user_since" : "2013-08-21T13:19:19Z",
      "email" : "info@organisedminds.com",
      "avatar" : {
         "thumb_url" : "https://app.organisedminds.com/assets/app/no-profile.jpg",
         "url" : "https://app.organisedminds.com/assets/app/no-profile.jpg"
      },
      "id" : "a98542857",
      "name_or_email" : "Tester The Great",
      "last_name" : "The Great",
      "first_name" : "Tester"
   }
}

Get all pending delegations

Return all delegations still pending

GET /api/delegations/pending

Example output

See all delegations

Get all outgoing delegations

Return all outgoing delegations

GET /api/delegations/outgoing

Example output

See all delegations

Get all incoming delegations

Return all incoming delegations

GET /api/delegations/incoming

Example output

See all delegations

Get all pending outgoing delegations

Return all outgoing delegations still pending

GET /api/delegations/outgoing/pending

Example output

See all delegations

Get all pending incoming delegations

Return all incoming delegations still pending

GET /api/delegations/incoming/pending

Example output

See all delegations

Accept a delegation

Accept an incoming pending delegation

PUT /api/delegations/:id/accept

Returns the updated delegation

Decline a delegation

Decline an incoming pending delegation

PUT /api/delegations/:id/decline

Returns the updated delegation

Redelegate

Push an incoming, pending delegation to another user. You can specify slug (id) or email and leave a delegation note.

slug has preference if you happen to supply both

POST /api/delegations/:id/redelegate

{"slug":"4095849584", "note":"Will you do this for me"}

or

POST /api/delegations/:id/redelegate

{"email":"you@example.com", "note":"Will you do this for me"}

Returns the newly created delegation

When you delegate by e-mail and the supplied e-mail address does not exist on the server, the user will be invited and the API will respond with Status: 202.

The delegation will not be created until the user accepts the invitation.

Revoke a delegation

As delegations cannot be deleted (history cannot be rewritten), the delegation is not deleted (as the request-method suggests), but rather a take-back is triggered on the activity.

Works only on pending outgoign delegations

DELETE /api/delegations/:id

Returns the updated delegation

comments powered by Disqus