test1.freedica.com

Friendica API

Overview

Friendica provides the following specific endpoints.

Authentication is the same as described in Using the APIs.

Entities

These endpoints uses the Friendica API entities.

Endpoints

GET api/friendica/events

Returns a list of Event entities for the current logged in user.

Parameters

POST api/friendica/event_create

Create a new event for the current logged in user.

Parameters

POST api/friendica/event_delete

Delete event from calendar (not the message)

Parameters

GET api/externalprofile/show

Returns a Contact entity for the provided profile URL.

Parameters

GET api/statuses/public_timeline

Returns a list of public Items posted on this node. Equivalent of the local community page.

Parameters

Unsupported parameters

GET api/statuses/networkpublic_timeline

Returns a list of public Items this node is aware of. Equivalent of the global community page.

Parameters

GET api/statuses/replies

Parameters

Unsupported parameters


GET api/conversation/show

Unofficial Twitter command. It shows all direct answers (excluding the original post) to a given id.

Parameters

Unsupported parameters

GET api/statusnet/conversation

Alias of api/conversation/show.

GET api/statusnet/config

Returns the public Friendica node configuration.

GET api/gnusocial/config

Alias of api/statusnet/config.

GET api/statusnet/version

Returns a fake static StatusNet protocol version.

GET api/gnusocial/version

Alias of api/statusnet/version.


POST api/friendica/activity/[verb]

Add or remove an activity from an item. 'verb' can be one of:

To remove an activity, prepend the verb with "un", eg. "unlike" or "undislike" Attend verbs disable each other: that means that if "attendyes" was added to an item, adding "attendno" remove previous "attendyes". Attend verbs should be used only with event-related items (there is no check at the moment).

Parameters

Return values

On success: json:

"ok"

xml:

<ok>true</ok>

On error: HTTP 400 BadRequest


GET api/direct_messages

Deprecated Twitter received direct message list endpoint.

Parameters

Unsupported parameters

GET api/direct_messages/all

Returns all Private Messages.

Parameters

GET api/direct_messages/conversation

Returns all replies of a single private message conversation. Returns Private Messages

Parameters

GET api/direct_messages/sent

Deprecated Twitter sent direct message list endpoint. Returns Private Messages.

Parameters

POST api/direct_messages/new

Deprecated Twitter direct message submission endpoint.

Parameters

POST api/direct_messages/destroy

Deprecated Twitter direct message deletion endpoint.

Parameters

Return values

On success:

On error: HTTP 400 BadRequest

GET api/friendica/direct_messages_setseen

Parameters

Return values

On success:

On error:

GET api/friendica/direct_messages_search (GET; AUTH)

Returns Private Messages matching the provided search string.

Parameters

Return values

Returns only tested with JSON, XML might work as well.

On success:

On error:


GET api/friendica/circle_show

Alternatively: GET api/friendica/group_show (Backward compatibility)

Return all or a specified circle of the user with the containing contacts as array.

Parameters

Return values

Array of:

POST api/friendica/circle_create

Alternatively: POST api/friendica/group_create

Create the circle with the posted array of contacts as members.

Parameters

POST data

JSON data as Array like the result of GET api/friendica/circle_show:

Return values

Array of:

POST api/friendica/circle_update

Alternatively: POST api/friendica/group_update

Update the circle with the posted array of contacts as members (post all members of the circle to the call; function will remove members not posted).

Parameters

POST data

JSON data as array like the result of GET api/friendica/circle_show:

Return values

Array of:

POST api/friendica/circle_delete

Alternatively: POST api/friendica/group_delete

Delete the specified circle of contacts; API call need to include the correct gid AND name of the circle to be deleted.

Parameters

Return values

Array of:


GET api/friendica/notifications

Return last 50 Notifications for the current user, ordered by date with unseen item on top.

Parameters

none

POST api/friendica/notifications/seen

Set notification as seen.

Parameters

Return values

If the note is linked to an item, returns an Item.

Otherwise, a success status is returned:


GET api/friendica/photo

Returns a Photo.

Parameters

Returns data of a picture with the given resource. If 'scale' isn't provided, returned data include full url to each scale of the photo. If 'scale' is set, returned data include image data base64 encoded.

possibile scale value are:

An image used as profile image has only scale 4-6, other images only 0-3

Return values

json:

    {
        "id": "photo id",
        "created": "date(YYYY-MM-DD HH:MM:SS)",
        "edited": "date(YYYY-MM-DD HH:MM:SS)",
        "title": "photo title",
        "desc": "photo description",
        "album": "album name",
        "filename": "original file name",
        "type": "mime type",
        "height": "number",
        "width": "number",
        "profile": "1 if is profile photo",
        "link": {
            "<scale>": "url to image",
            ...
        },
        // if 'scale' is set
        "datasize": "size in byte",
        "data": "base64 encoded image data"
    }

xml:

    <photo>
        <id>photo id</id>
        <created>date(YYYY-MM-DD HH:MM:SS)</created>
        <edited>date(YYYY-MM-DD HH:MM:SS)</edited>
        <title>photo title</title>
        <desc>photo description</desc>
        <album>album name</album>
        <filename>original file name</filename>
        <type>mime type</type>
        <height>number</height>
        <width>number</width>
        <profile>1 if is profile photo</profile>
        <links type="array">
        <link type="mime type" scale="scale number" href="image url"/>
            ...
        </links>
    </photo>

GET api/friendica/photos/list

Returns the API user's Photo List Items.

Return values

json:

    [
        {
            "id": "resource_id",
            "album": "album name",
            "filename": "original file name",
            "type": "image mime type",
            "thumb": "url to thumb sized image"
        },
        ...
    ]

xml:

    <photos type="array">
        <photo id="resource_id"
        album="album name"
        filename="original file name"
        type="image mime type">
            "url to thumb sized image"
        </photo>
        ...
    </photos>

POST api/friendica/photo/create

Alias of api/friendica/photo/update

POST api/friendica/photo/update

Saves data for the scales 0-2 to database (see above for scale description). Call adds non-public entries to items table to enable authenticated contacts to comment/like the photo. Client should pay attention to the fact that updated access rights are not transferred to the contacts. i.e. public photos remain publicly visible if they have been commented/liked before setting visibility back to a limited circle. Currently it is best to inform user that updating rights is not the right way to do this, and offer a solution to add photo as a new photo with the new rights instead.

Parameters

Return values

On success:

On error:

POST api/friendica/photo/delete

Deletes a single image with the specified id, is not reversible -> ensure that client is asking user for being sure to do this Sets item table entries for this photo to deleted = 1.

Parameters

Return values

On success:

{
    "result": "deleted",
    "message": "photo with id 'xyz' has been deleted from server."
}

On error:


POST api/friendica/photoalbum/delete

Deletes all images with the specified album name, is not reversible -> ensure that client is asking user for being sure to do this.

Parameters

Return values

On success:

{
    "result": "deleted",
    "message": "album 'xyz' with all containing photos has been deleted."
}

On error:

POST api/friendica/photoalbum/update

Changes the album name to album_new for all photos in album.

Parameters

Return values

On success:

{
  "result": "updated",
  "message":"album 'abc' with all containing photos has been renamed to 'xyz'."
}

On error:

GET api/friendica/photoalbums

Get a list of photo albums for the user

Parameters

None

Return values

On success a list of photo album objects:

[
  {
    "name": "Wall Photos",
    "created": "2023-01-22 02:03:19",
    "count": 4
  },
  {
    "name": "Profile photos",
    "created": "2022-11-20 14:40:06",
    "count": 1
  }
]

GET api/friendica/photoalbum

Get a list of images in a photo album

Parameters

Return values

On success:

Example: https://<server>/api/friendica/photoalbum?album=Wall Photos&limit=10&offset=2

[
  {
    "created": "2023-02-14 14:31:06",
    "edited": "2023-02-14 14:31:14",
    "title": "",
    "desc": "",
    "album": "Wall Photos",
    "filename": "image.png",
    "type": "image/png",
    "height": 835,
    "width": 693,
    "datasize": 119523,
    "profile": 0,
    "allow_cid": "",
    "deny_cid": "",
    "allow_gid": "",
    "deny_gid": "",
    "id": "899184972463eb9b2ae3dc2580502826",
    "scale": 0,
    "media-id": 52,
    "scales": [
      {
        "id": 52,
        "scale": 0,
        "link": "https://<server>/photo/899184972463eb9b2ae3dc2580502826-0.png",
        "width": 693,
        "height": 835,
        "size": 119523
      },
      ...
    ],
    "thumb": "https://<server>/photo/899184972463eb9b2ae3dc2580502826-2.png"
  },
  ...
]

GET api/friendica/profile/show

Returns the Profile data of the authenticated user.

Return values

On success: Array of:

On error: HTTP 403 Forbidden: when no authentication was provided HTTP 400 Bad Request: if given profile_id is not in the database or is not assigned to the authenticated user

General description of profile data in API returns: - hide_friends: true if friends are hidden - profile_photo - profile_thumb - publish: true if published on the server's local directory - net_publish: true if published to global_dir - fullname - date_of_birth - description - xmpp - homepage - address - locality - region - postal_code - country - pub_keywords - custom_fields: list of public custom fields


POST api/friendica/statuses/:id/dislike

Marks the given status as disliked by this user

Path Parameter

Return values

A Mastodon Status Entity

Example:

https://<server_name>/api/friendica/statuses/341/dislike

{
  "id": "341",
  "created_at": "2023-02-23T01:50:00.000Z",
  "in_reply_to_id": null,
  "in_reply_to_status": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": "en",
  ...
  "account": {
    "id": "8",
    "username": "testuser2",
    ...
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "card": null,
  "poll": null,
  "friendica": {
    "title": "",
    "dislikes_count": 1,
    "disliked": true
  }
}

GET api/friendica/statuses/:id/disliked_by

Returns the list of accounts that have disliked the status as known by the current server

Path Parameter

Return values

A list of Mastodon Account objects in the body and next/previous link headers in the header

Example:

https://<server_name>/api/friendica/statuses/341/disliked_by

[
  {
    "id": "6",
    "username": "testuser1",
    ...
  }
]

POST api/friendica/statuses/:id/undislike

Removes the dislike mark (if it exists) on this status for this user

Path Parameter

Return values

A Mastodon Status Entity

Example:

https://<server_name>/api/friendica/statuses/341/undislike

{
  "id": "341",
  "created_at": "2023-02-23T01:50:00.000Z",
  "in_reply_to_id": null,
  "in_reply_to_status": null,
  "in_reply_to_account_id": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": "public",
  "language": "en",
  ...
  "account": {
    "id": "8",
    "username": "testuser2",
    ...
  },
  "media_attachments": [],
  "mentions": [],
  "tags": [],
  "emojis": [],
  "card": null,
  "poll": null,
  "friendica": {
    "title": "",
    "dislikes_count": 0,
    "disliked": false
  }
}

Deprecated endpoints