Freefeed API
Unoficial Freefeed API documentation.
Authentication
To obtain API token:
require 'freefeed'
client = Freefeed::Client.new()
client.authenticate(username: 'yourusername', password: 'yourpassword')
curl "https://freefeed.net/v1/session"
-X POST
-d "username=yourusername&password=yourpassword"
The above command returns JSON structured like this:
{
"users": {
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"type": "user",
"screenName": "your FUNNY username",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"isPrivate": "0",
"isProtected": "0",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "9",
"likes": "0",
"comments": "0",
"subscribers": "0",
"subscriptions": "2"
},
"administrators": [
"920196ff-f2b0-4319-8fb2-626e4ac76d2c"
]
},
"admins": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"type": "user",
"screenName": "your FUNNY username",
"updatedAt": "1538770654480",
"isPrivate": "0",
"isProtected": "0",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"administrators": [
{
}
],
"statistics": {
"posts": "9",
"likes": "0",
"comments": "0",
"subscribers": "0",
"subscriptions": "2"
}
}
],
"authToken": "yourFreefeedAPIToken"
}
To authenticate by the API key, use this code:
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
-H "x-authentication-token: yourFreefeedAPIToken"
Make sure to replace
yourFreefeedAPITokenwith your API key.
Freefeed uses API keys to allow access to the API. You can get your API key on the settings page (BetterFeed should be turned on), or on the settings page of m.freefeed.net frontend (no need for BetterFeed).
Or you can obtain your API key by providing your username and password.
HTTP Request
POST https://freefeed.net/v1/session
POST Payload
| Parameter | Description |
|---|---|
| username | Your username |
| password | Your password |
Freefeed expects for the API key to be included in most API requests to the server in a header that looks like the following:
x-authentication-token: yourFreefeedAPIToken
Attachments
Create Attachment
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Attachment.create(
client,
file: Faraday::UploadIO.new("/path/to/your/file.jpg", 'image/jpeg')
)
curl "https://freefeed.net/v1/attachments"
-H "x-authentication-token: yourFreefeedAPIToken"
-F "file=@/path/to/your/file.jpg"
The above command returns JSON structured like this:
{
"attachments": {
"id": "dd2f5eaa-dad8-439a-93cc-6bdcf74ecee0",
"fileName": "file.jpg",
"fileSize": 75694,
"url": "https:\/\/media.freefeed.net\/attachments\/dd2f5eaa-dad8-439a-93cc-6bdcf74ecee0.jpg",
"thumbnailUrl": "https:\/\/media.freefeed.net\/attachments\/thumbnails\/dd2f5eaa-dad8-439a-93cc-6bdcf74ecee0.jpg",
"imageSizes": {
"o": {
"w": 700,
"h": 465,
"url": "https:\/\/media.freefeed.net\/attachments\/dd2f5eaa-dad8-439a-93cc-6bdcf74ecee0.jpg"
},
"t": {
"w": 263,
"h": 175,
"url": "https:\/\/media.freefeed.net\/attachments\/thumbnails\/dd2f5eaa-dad8-439a-93cc-6bdcf74ecee0.jpg"
},
"t2": {
"w": 527,
"h": 350,
"url": "https:\/\/media.freefeed.net\/attachments\/thumbnails2\/dd2f5eaa-dad8-439a-93cc-6bdcf74ecee0.jpg"
}
},
"mediaType": "image",
"createdAt": 1539380940526,
"updatedAt": 1539380940526,
"createdBy": "920196ff-f2b0-4319-8fb2-626e4ac76d2c"
},
"admins": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"type": "user",
"screenName": "your FUNNY username",
"updatedAt": "1538770654480",
"isPrivate": "0",
"isProtected": "0",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"administrators": [
{
}
],
"statistics": {
"posts": "9",
"likes": "0",
"comments": "0",
"subscribers": "0",
"subscriptions": "2"
}
}
],
"users": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"type": "user",
"screenName": "your FUNNY username",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"isPrivate": "0",
"isProtected": "0",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "9",
"likes": "0",
"comments": "0",
"subscribers": "0",
"subscriptions": "2"
},
"administrators": [
"920196ff-f2b0-4319-8fb2-626e4ac76d2c"
]
}
]
}
This endpoint creates an attachment.
HTTP Request
Multipart upload request:
POST https://freefeed.net/v1/attachments
Post payload
| Parameter | Description |
|---|---|
| file | Contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. |
Bookmarklet
Create Bookmarklet
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
bookmarklet = Freefeed::Types::Bookmarklet.new(
title: 'New Post',
comment: 'First comment',
image: 'http://example.com/image.jpeg'
)
Freefeed::Bookmarklet.create(client, bookmarklet)
curl "https://freefeed.net/v1/bookmarklet"
-H "x-authentication-token: yourFreefeedAPIToken"
-H "content-type: application/json"
-d '{"Title":"New Post","comment":"First comment","image":"http://example.com/image.jpeg"}'
The above command returns JSON structured like this:
{
"posts": {
"id": "7ef5649e-ef13-4a26-aeee-e9c33d94cd0f",
"body": "New Post",
"commentsDisabled": "0",
"createdAt": "1539429526882",
"updatedAt": "1539429526882",
"commentLikes": 0,
"ownCommentLikes": 0,
"omittedCommentLikes": 0,
"omittedOwnCommentLikes": 0,
"createdBy": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"postedTo": [
"28c68cc1-5bb4-40bd-9767-155c1de480a0"
],
"comments": [
"ebf22ee2-8825-420e-9e0a-b7eaf2f669f9"
],
"attachments": [
"f508e4f2-bc0d-4648-a364-fd004ef30a26"
],
"likes": [
],
"omittedComments": 0,
"omittedLikes": 0
},
"users": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "youru FUNNY sername",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "11",
"likes": "0",
"comments": "4",
"subscribers": "0",
"subscriptions": "2"
}
}
],
"subscriptions": [
{
"id": "28c68cc1-5bb4-40bd-9767-155c1de480a0",
"name": "Posts",
"user": "920196ff-f2b0-4319-8fb2-626e4ac76d2c"
}
],
"subscribers": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "11",
"likes": "0",
"comments": "4",
"subscribers": "0",
"subscriptions": "2"
}
}
],
"comments": [
{
"id": "ebf22ee2-8825-420e-9e0a-b7eaf2f669f9",
"body": "First comment",
"createdAt": "1539429527056",
"updatedAt": "1539429527056",
"hideType": 0,
"likes": 0,
"hasOwnLike": false,
"createdBy": "920196ff-f2b0-4319-8fb2-626e4ac76d2c"
}
],
"attachments": [
{
"id": "f508e4f2-bc0d-4648-a364-fd004ef30a26",
"fileName": "1fd58ad4-4ce4-47dd-a91c-0a6ddfb31ccb.jpg",
"fileSize": "42494",
"url": "https:\/\/media.freefeed.net\/attachments\/f508e4f2-bc0d-4648-a364-fd004ef30a26.jpg",
"thumbnailUrl": "https:\/\/media.freefeed.net\/attachments\/f508e4f2-bc0d-4648-a364-fd004ef30a26.jpg",
"imageSizes": {
"o": {
"w": 350,
"h": 175,
"url": "https:\/\/media.freefeed.net\/attachments\/f508e4f2-bc0d-4648-a364-fd004ef30a26.jpg"
}
},
"mediaType": "image",
"createdAt": "1539429526723",
"updatedAt": "1539429526723",
"createdBy": "920196ff-f2b0-4319-8fb2-626e4ac76d2c"
}
]
}
This endpoint creates a post (optionally with a comment and an attachment).
HTTP Request
Multipart upload request:
POST https://freefeed.net/v1/bookmarklet
JSON Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | String | Yes | A body of the post. Must include at least one \S character |
| comment | String | No | First comment to the post |
| image | String | No | URL of an image attachment to the post |
| images | Array of String | No | Array or URLs of image attachments to the post |
| meta | MetaBookmarklet | No |
MetaBookmarklet
| Parameter | Type | Required | Description |
|---|---|---|---|
| feeds | String or Array of String | Yes | Username or groupname or array of username and/or groupnames which the post should be posted to |
Comments
Create Comment
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
comment = Freefeed::Types::CommentCreate.new(
comment: { body: "Hi, love!", postId: '5579b79b-c5f5-464c-b101-638de4a8f335'}
)
Freefeed::Comment.create(client, comment)
curl "https://freefeed.net/v1/comments"
-H "x-authentication-token: yourFreefeedAPIToken"
-H "content-type: application/json"
-d '{"comment":{"body":"Hi, love!","postId":"5579b79b-c5f5-464c-b101-638de4a8f335"}}'
The above command returns JSON structured like this:
{
"comments": {
"id": "8cb67cab-0b4e-46ce-94bb-90b6eb2cc092",
"body": "Hi, love!",
"createdAt": "1539384483129",
"createdBy": "920196ff-f2b0-4319-8fb2-626e4ac76d2c"
},
"users": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "9",
"likes": "0",
"comments": "3",
"subscribers": "0",
"subscriptions": "2"
}
}
],
"admins": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "9",
"likes": "0",
"comments": "3",
"subscribers": "0",
"subscriptions": "2"
}
}
]
}
This endpoint creates a comment.
HTTP Request
POST https://freefeed.net/v1/comments
JSON Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| comment | CommentCreate | Yes | See CommentCreate |
CommentCreate
| Parameter | Type | Required | Description |
|---|---|---|---|
| body | String | Yes | A body of the comment. Must include at least one \S character |
| postId | String | Yes | Id of the post for the comment |
Update Comment
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
comment = Freefeed::Types::CommentUpdate.new(comment: { body: "Bye bye happiness"})
Freefeed::Comment.update(client, {id: '8cb67cab-0b4e-46ce-94bb-90b6eb2cc092'}, comment)
curl "https://freefeed.net/v1/comments/8cb67cab-0b4e-46ce-94bb-90b6eb2cc092"
-X PUT
-H "x-authentication-token: yourFreefeedAPIToken"
-H "content-type: application/json"
-d '{"comment":{"body":"Bye bye happiness"}}'
The above command returns JSON structured like this:
{
"comments": {
"id": "8cb67cab-0b4e-46ce-94bb-90b6eb2cc092",
"body": "Bye bye happiness",
"createdAt": "1539384483129",
"createdBy": "920196ff-f2b0-4319-8fb2-626e4ac76d2c"
},
"users": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "9",
"likes": "0",
"comments": "3",
"subscribers": "0",
"subscriptions": "2"
}
}
],
"admins": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "9",
"likes": "0",
"comments": "3",
"subscribers": "0",
"subscriptions": "2"
}
}
]
}
This endpoint updates a comment.
HTTP Request
PUT https://freefeed.net/v1/comments/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the comment to update |
JSON Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| comment | CommentUpdate | Yes | See CommentUpdate |
CommentUpdate
| Parameter | Type | Required | Description |
|---|---|---|---|
| body | String | Yes | A body of the comment. Must include at least one \S character |
Delete Comment
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Comment.destroy(client, id: '8cb67cab-0b4e-46ce-94bb-90b6eb2cc092')
curl "https://freefeed.net/v1/comments/8cb67cab-0b4e-46ce-94bb-90b6eb2cc092"
-X DELETE
-H "x-authentication-token: yourFreefeedAPIToken"
The above command returns empty JSON
{}
This endpoint deletes a specific comment.
HTTP Request
DELETE https://freefeed.net/v1/comments/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the comment to delete |
Errors
| Code | JSON |
|---|---|
| 403 | {"err":"You don't have permission to delete this comment"} |
| 404 | {"err":"Can not find comment"} |
Like Comment
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Comment.like(client, id: '56d1864d-0d58-49b8-9827-109850991f60')
curl "https://freefeed.net/v2/comments/56d1864d-0d58-49b8-9827-109850991f60/like"
-H "x-authentication-token: yourFreefeedAPIToken"
-X POST
The above command returns JSON structured like this:
{
"likes": [
{
"userId": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"createdAt": "2018-10-12T23:32:10.109Z"
}
],
"users": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "9",
"likes": "0",
"comments": "2",
"subscribers": "0",
"subscriptions": "2"
}
}
]
}
This endpoint likes a specific post.
HTTP Request
POST https://freefeed.net/v2/comments/<ID>/like
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the comment to like |
Unlike Comment
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Comment.unlike(client, id: '56d1864d-0d58-49b8-9827-109850991f60')
curl "https://freefeed.net/v2/comments/56d1864d-0d58-49b8-9827-109850991f60/unlike"
-H "x-authentication-token: yourFreefeedAPIToken"
-X POST
The above command returns JSON structured like this:
{"likes":[],"users":[]}
This endpoint likes a specific post.
HTTP Request
POST https://freefeed.net/v2/comments/<ID>/unlike
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the comment to unlike |
Get Likes of a Comment
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Comment.likes(client, id: '56d1864d-0d58-49b8-9827-109850991f60')
curl "https://freefeed.net/v2/comments/56d1864d-0d58-49b8-9827-109850991f60/likes"
-H "x-authentication-token: yourFreefeedAPIToken"
The above command returns JSON structured like this:
{
"likes": [
{
"userId": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"createdAt": "2018-10-12T23:32:10.109Z"
}
],
"users": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "9",
"likes": "0",
"comments": "2",
"subscribers": "0",
"subscriptions": "2"
}
}
]
}
This endpoint returns likes of a specific comment.
HTTP Request
GET https://freefeed.net/v2/comments/<ID>/likes
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the comment for which you want to get likes |
Posts
Get Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Post.get(client, id: '7c70927a-4e51-49e7-bfe1-33bc4c1c0618')
curl "https://freefeed.net/v2/posts/7c70927a-4e51-49e7-bfe1-33bc4c1c0618"
-H "x-authentication-token: yourFreefeedAPIToken"
The above command returns JSON structured like this:
{
"posts": {
"id": "7c70927a-4e51-49e7-bfe1-33bc4c1c0618",
"body": "FAQ: frequently asked questions (and answers). If you have more questions, please contact @support.",
"commentsDisabled": "1",
"createdAt": "1449074608680",
"updatedAt": "1475924950194",
"commentLikes": 0,
"ownCommentLikes": 0,
"omittedCommentLikes": 0,
"omittedOwnCommentLikes": 0,
"createdBy": "5df98f17-6085-4a14-bcdc-1ae07cb1957f",
"postedTo": [
"8b7db31d-d5f4-41be-a159-829cf9470007"
],
"comments": [
"1f96e911-e1d7-44b7-81f1-fa3da5bb449e",
"1d5f34cd-59fb-4967-af90-ae56a60d5392"
],
"attachments": [
],
"likes": [
"ec3a56c7-19b1-4f07-864c-9e643c97ced3",
"46dbbdbe-efbb-4f91-a853-b91d199176a1",
"6726abcb-dcc3-4115-9b13-16332dd4cb1d"
],
"omittedComments": 25,
"omittedLikes": 8
},
"users": [
{
"id": "5df98f17-6085-4a14-bcdc-1ae07cb1957f",
"username": "welcome",
"screenName": "welcome",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1448302642164",
"updatedAt": "1452687756552",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "3",
"likes": "1",
"comments": "40",
"subscribers": "2009",
"subscriptions": "0"
}
},
],
"subscriptions": [
{
"id": "8b7db31d-d5f4-41be-a159-829cf9470007",
"name": "Posts",
"user": "5df98f17-6085-4a14-bcdc-1ae07cb1957f"
}
],
"subscribers": [
{
"id": "5df98f17-6085-4a14-bcdc-1ae07cb1957f",
"username": "welcome",
"screenName": "welcome",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1448302642164",
"updatedAt": "1452687756552",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "3",
"likes": "1",
"comments": "40",
"subscribers": "2009",
"subscriptions": "0"
}
}
],
"comments": [
{
"id": "1f96e911-e1d7-44b7-81f1-fa3da5bb449e",
"body": "== About FreeFeed:",
"createdAt": "1449074650399",
"updatedAt": "1475924960830",
"hideType": 0,
"likes": 0,
"hasOwnLike": false,
"createdBy": "5df98f17-6085-4a14-bcdc-1ae07cb1957f"
},
{
"id": "1d5f34cd-59fb-4967-af90-ae56a60d5392",
"body": "If you have more questions, you can ask them at @support. If you have anything to add to the FAQ here, you can do it here: https:\/\/freefeed.net\/freefeed\/ef954a33-39a3-43e5-a62d-698ed55c9548",
"createdAt": "1449075294335",
"updatedAt": "1475928090704",
"hideType": 0,
"likes": 0,
"hasOwnLike": false,
"createdBy": "5df98f17-6085-4a14-bcdc-1ae07cb1957f"
}
],
"attachments": [
]
}
This endpoint retrieves a specific post.
HTTP Request
GET https://freefeed.net/v2/posts/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the post to retrieve |
Create Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
post = Freefeed::Types::PostCreate.new(
{
post: {
body: 'Hello World!'
},
meta: {
feeds: ['username']
}
}
)
Freefeed::Post.create(client, post)
curl "https://freefeed.net/v1/posts"
-H "content-type: application/json"
-H "x-authentication-token: yourFreefeedAPIToken"
-d '{"post":{"body":"HelloWorld!"},"meta":{"feeds":["yourusername"],"commentsDisabled":false}}'
The above command returns JSON structured like this:
{
"posts": {
"id": "7c70927a-4e51-49e7-bfe1-33bc4c1c0618",
"body": "HelloWorld!",
"commentsDisabled": "0",
"createdAt": "1539348845566",
"updatedAt": "1539348845566",
"commentLikes": 0,
"ownCommentLikes": 0,
"omittedCommentLikes": 0,
"omittedOwnCommentLikes": 0,
"createdBy": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"postedTo": [
"28c68cc1-5bb4-40bd-9767-155c1de480a0"
],
"comments": [
],
"attachments": [
],
"likes": [
],
"omittedComments": 0,
"omittedLikes": 0
},
"users": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "10",
"likes": "0",
"comments": "0",
"subscribers": "0",
"subscriptions": "1"
}
}
],
"subscriptions": [
{
"id": "28c68cc1-5bb4-40bd-9767-155c1de480a0",
"name": "Posts",
"user": "920196ff-f2b0-4319-8fb2-626e4ac76d2c"
}
],
"subscribers": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "10",
"likes": "0",
"comments": "0",
"subscribers": "0",
"subscriptions": "1"
}
}
],
"comments": [
],
"attachments": [
]
}
This endpoint creates a post.
HTTP Request
POST https://freefeed.net/v1/posts
JSON Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| post | PostCreate | Yes | See PostCreate |
| meta | MetaCreate | Yes | See MetaCreate |
PostCreate
| Parameter | Type | Required | Description |
|---|---|---|---|
| body | String | Yes | A body of the post. Must include at least one \S character |
| attachments | Array of UID | No | Array of previously uploaded attachmets ids |
MetaCreate
| Parameter | Type | Required | Description |
|---|---|---|---|
| commentsDisabled | Boolean | No | Indicates whether comments for the post should be disabled (Default is false) |
| feeds | String or Array of String | Yes | Username or groupname or array of username and groupnames which the post should be posted to |
Delete Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Post.destroy(client, id: '7c70927a-4e51-49e7-bfe1-33bc4c1c0618')
curl "https://freefeed.net/v1/posts/7c70927a-4e51-49e7-bfe1-33bc4c1c0618"
-X DELETE
-H "x-authentication-token: yourFreefeedAPIToken"
The above command returns JSON structured like this:
{
"postStillAvailable": false
}
This endpoint deletes a specific post.
HTTP Request
DELETE https://freefeed.net/v1/posts/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the post to delete |
Errors
| Code | JSON |
|---|---|
| 403 | {"err":"You can't delete another user's post"} |
| 404 | {"err":"Post not found"} |
Update Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
post = Freefeed::Types::PostUpdate.new( { post: { body: 'HelloWorldAgain!' } } )
Freefeed::Post.update(client, {id: '7c70927a-4e51-49e7-bfe1-33bc4c1c0618'}, post)
curl "https://freefeed.net/v1/posts/7c70927a-4e51-49e7-bfe1-33bc4c1c0618"
-X PUT
-H "content-type: application/json"
-H "x-authentication-token: yourFreefeedAPIToken"
-d '{"post":{"body":"HelloWorldAgain!"}}'
The above command returns JSON structured like this:
{
"posts": {
"id": "7c70927a-4e51-49e7-bfe1-33bc4c1c0618",
"body": "HelloWorldAgain!",
"commentsDisabled": "0",
"createdAt": "1539348845566",
"updatedAt": "1539348845566",
"commentLikes": 0,
"ownCommentLikes": 0,
"omittedCommentLikes": 0,
"omittedOwnCommentLikes": 0,
"createdBy": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"postedTo": [
"28c68cc1-5bb4-40bd-9767-155c1de480a0"
],
"comments": [
],
"attachments": [
],
"likes": [
],
"omittedComments": 0,
"omittedLikes": 0
},
"users": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "10",
"likes": "0",
"comments": "0",
"subscribers": "0",
"subscriptions": "1"
}
}
],
"subscriptions": [
{
"id": "28c68cc1-5bb4-40bd-9767-155c1de480a0",
"name": "Posts",
"user": "920196ff-f2b0-4319-8fb2-626e4ac76d2c"
}
],
"subscribers": [
{
"id": "920196ff-f2b0-4319-8fb2-626e4ac76d2c",
"username": "yourusername",
"screenName": "your FUNNY username",
"isPrivate": "0",
"isProtected": "0",
"createdAt": "1538770654480",
"updatedAt": "1538770654480",
"type": "user",
"description": "",
"profilePictureLargeUrl": "",
"profilePictureMediumUrl": "",
"statistics": {
"posts": "10",
"likes": "0",
"comments": "0",
"subscribers": "0",
"subscriptions": "1"
}
}
],
"comments": [
],
"attachments": [
]
}
This endpoint updates a specific post.
HTTP Request
PUT https://freefeed.net/v1/posts/<ID>
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the post to update |
JSON Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| post | PostUpdate | Yes | See PostUpdate |
PostUpdate
At least one parameter required!
| Parameter | Type | Required | Description |
|---|---|---|---|
| body | String | No | A body of the post. Must include at least one \S character |
| attachments | Array of UID | No | Array of previously uploaded attachmets ids |
| feeds | Array of String | No | Array of username and/or groupnames where the post should be posted to |
Like Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Post.like(client, id: 'b4a6aca7-c0e0-4b84-a586-30abbf8c29b2')
curl "https://freefeed.net/v1/posts/b4a6aca7-c0e0-4b84-a586-30abbf8c29b2/like"
-H "x-authentication-token: yourFreefeedAPIToken"
-X POST
The above command returns empty JSON:
{}
This endpoint likes a specific post.
HTTP Request
POST https://freefeed.net/v1/posts/<ID>/like
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the post to like |
Errors
| Code | JSON |
|---|---|
| 403 | {"err":"You can't like post that you have already liked"} |
| 403 | {"err":"You can't like your own post"} |
| 404 | {"err":"Can't find post"} |
Unlike Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Post.unlike(client, id: 'b4a6aca7-c0e0-4b84-a586-30abbf8c29b2')
curl "https://freefeed.net/v1/posts/b4a6aca7-c0e0-4b84-a586-30abbf8c29b2/unlike"
-H "x-authentication-token: yourFreefeedAPIToken"
-X POST
The above command returns empty JSON:
{}
This endpoint unlikes a specific post.
HTTP Request
POST https://freefeed.net/v1/posts/<ID>/unlike
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the post to unlike |
Errors
| Code | JSON |
|---|---|
| 403 | {"err":"You can't un-like post that you haven't yet liked"} |
| 404 | {"err":"Can't find post"} |
Hide Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Post.hide(client, id: 'b4a6aca7-c0e0-4b84-a586-30abbf8c29b2')
curl "https://freefeed.net/v1/posts/b4a6aca7-c0e0-4b84-a586-30abbf8c29b2/hide"
-H "x-authentication-token: yourFreefeedAPIToken"
-X POST
The above command returns empty JSON:
{}
This endpoint likes a specific post.
HTTP Request
POST https://freefeed.net/v1/posts/<ID>/hide
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the post to like |
Errors
| Code | JSON |
|---|---|
| 404 | {"err":"Can't find post"} |
Unhide Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Post.unhide(client, id: 'b4a6aca7-c0e0-4b84-a586-30abbf8c29b2')
curl "https://freefeed.net/v1/posts/b4a6aca7-c0e0-4b84-a586-30abbf8c29b2/unhide"
-H "x-authentication-token: yourFreefeedAPIToken"
-X POST
The above command returns empty JSON:
{}
This endpoint unlikes a specific post.
HTTP Request
POST https://freefeed.net/v1/posts/<ID>/unhide
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the post to unlike |
Errors
| Code | JSON |
|---|---|
| 404 | {"err":"Can't find post"} |
Disable comments for Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Post.disable_comments(client, id: 'b4a6aca7-c0e0-4b84-a586-30abbf8c29b2')
curl "https://freefeed.net/v1/posts/b4a6aca7-c0e0-4b84-a586-30abbf8c29b2/disableComments"
-H "x-authentication-token: yourFreefeedAPIToken"
-X POST
The above command returns empty JSON:
{}
This endpoint disables comments for a specific post.
HTTP Request
POST https://freefeed.net/v1/posts/<ID>/disableComments
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the post to like |
Errors
| Code | JSON |
|---|---|
| 403 | {"err":"You can't disable comments for another user's post"} |
| 404 | {"err":"Post not found"} |
Enable comments for Post
require 'freefeed'
client = Freefeed::Client.new('yourFreefeedAPIToken')
Freefeed::Post.enable_comments(client, id: 'b4a6aca7-c0e0-4b84-a586-30abbf8c29b2')
curl "https://freefeed.net/v1/posts/b4a6aca7-c0e0-4b84-a586-30abbf8c29b2/enableComments"
-H "x-authentication-token: yourFreefeedAPIToken"
-X POST
The above command returns empty JSON:
{}
This endpoint enables comments for a specific post.
HTTP Request
POST https://freefeed.net/v1/posts/<ID>/enableComments
URL Parameters
| Parameter | Description |
|---|---|
| ID | The ID of the post to unlike |
Errors
| Code | JSON |
|---|---|
| 403 | {"err":"You can't enable comments for another user's post"} |
| 404 | {"err":"Post not found"} |