REST interface for the social networking library (posts).
Retrieve ids (UUID) of the liked posts by the user
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| code | condition |
|---|---|
| 201 | Sccessfull retrieved ids, they are reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | ids (UUID) of the liked posts by the user in the context bound to the auth token |
GET /2/posts/get-id-liked-posts
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 201 Created
Content-Type: application/json
...
Retrieve posts liked by the user
| name | type | description | default | constraints |
|---|---|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources | ||
| Content-Type | header | application/json | ||
| limit | query | The maximum number of posts to be retrieved | 10 | min: 0 |
| code | condition |
|---|---|
| 200 | Successfull retrieved posts, they are reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | posts liked by the user (up to a given quantity) in the context bound to the auth token |
GET /2/posts/get-liked-posts
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
Retrieve a post by id
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| id | query |
| code | condition |
|---|---|
| 200 | Successful retrieval of posts, reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the post if the post id belongs to a post in the context identified by the token |
GET /2/posts/get-post
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
Retrieve the application's posts
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| code | condition |
|---|---|
| 200 | Successfull created, the new post is reported in the 'result' field of the returned object |
| 403 | "There is no application profile with such token |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the application (IAM Client) posts belonging to the token's owner (i.e., an application)" |
GET /2/posts/get-posts-app
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
Retrieve posts containing the hashtag in the context bound to the auth token
| name | type | description | constraints |
|---|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources | |
| Content-Type | header | application/json | |
| hashtag | query | he hashtag to be contained within the posts | required |
| code | condition |
|---|---|
| 201 | Sccessfull retrieved posts, they are reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the posts in the context bound to the auth token matching the hashtag |
GET /get-posts-by-hashtag?hashtag=#thehashtag
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 201 Created
Content-Type: application/json
...
Retrieve all user's posts
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| code | condition |
|---|---|
| 200 | Successful retrieval of posts, reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | all posts of the auth token's owner in the context identified by the token |
GET /2/posts/get-posts-user
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
Retrieve a given quantity of latest user's posts
| name | type | description | default | constraints |
|---|---|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources | ||
| Content-Type | header | application/json | ||
| quantity | query | the number of latest post to get | 10 | min: 0 |
| code | condition |
|---|---|
| 200 | Successful retrieval of posts, reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | all posts of the auth token's owner in the context identified by the token, in reverse chronological order up to quantity (at most) |
GET /get-posts-user-quantity?quantity=10
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
Retrieve posts of the auth token's owner, and allow to filter them by time"
| name | type | description | constraints |
|---|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources | |
| Content-Type | header | application/json | |
| time | query | The reference time since when retrieving posts | required long, min: 0 |
| code | condition |
|---|---|
| 200 | Successful retrieval of posts, reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | the posts |
GET /2/posts/get-posts-user-since
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 200 OK
Content-Type: application/json
...
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| code | condition |
|---|---|
| 201 | Sccessfull retrieved posts, they are reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | all the posts in the context bound to the auth token |
GET /2/posts/get-posts-vre
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 201 Created
Content-Type: application/json
...
return the most recent posts for this vre up to quantity param and the last index of the posts in the timeline lastReturnedPostTimelineIndex is useful to know from where to start the range the next time you ask, because there are deletions
| name | type | description | constraints |
|---|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources | |
| Content-Type | header | application/json | |
| from | query | the range start (most recent feeds for this vre) has to be greater than 0 | required int, min: 1 |
| quantity | query | the number of most recent feeds for this vre starting from "from" param | required int, min: 1 |
| code | condition |
|---|---|
| 201 | Sccessfull retrieved posts, they are reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) | a |
GET /get-recent-posts-vre-by-range?from=1&quantity=10
Content-Type: */*
Accept: application/json
Authorization: ...
...
HTTP/1.1 201 Created
Content-Type: application/json
...
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| media type | data type |
|---|---|
| application/json | PostWithAttachment (JSON) |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) |
POST /2/posts/save-app-post-attachments-lib
Content-Type: application/json
Accept: application/json
Authorization: ...
{
"attachments" : [ {
"uri" : "...",
"mimeType" : "...",
"name" : "...",
"thumbnailURL" : "...",
"id" : "...",
"description" : "..."
}, {
"uri" : "...",
"mimeType" : "...",
"name" : "...",
"thumbnailURL" : "...",
"id" : "...",
"description" : "..."
} ],
"post" : {
"likesNo" : "...",
"uri" : "...",
"email" : "...",
"uriThumbnail" : "...",
"key" : "...",
"commentsNo" : "...",
"vreid" : "...",
"fullName" : "...",
"applicationFeed" : true,
"description" : "...",
"type" : "JOIN",
"linkTitle" : "...",
"time" : 12345,
"privacy" : "SINGLE_VRE",
"multiFileUpload" : true,
"entityId" : "...",
"thumbnailURL" : "...",
"linkDescription" : "...",
"linkHost" : "..."
}
}
HTTP/1.1 201 Created
Content-Type: application/json
...
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| media type | data type |
|---|---|
| application/json | PostWithAttachment (JSON) |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) |
POST /2/posts/save-user-post-attachments-lib
Content-Type: application/json
Accept: application/json
Authorization: ...
{
"attachments" : [ {
"uri" : "...",
"mimeType" : "...",
"name" : "...",
"thumbnailURL" : "...",
"id" : "...",
"description" : "..."
}, {
"uri" : "...",
"mimeType" : "...",
"name" : "...",
"thumbnailURL" : "...",
"id" : "...",
"description" : "..."
} ],
"post" : {
"likesNo" : "...",
"uri" : "...",
"email" : "...",
"uriThumbnail" : "...",
"key" : "...",
"commentsNo" : "...",
"vreid" : "...",
"fullName" : "...",
"applicationFeed" : true,
"description" : "...",
"type" : "ACCOUNTING",
"linkTitle" : "...",
"time" : 12345,
"privacy" : "PUBLIC",
"multiFileUpload" : true,
"entityId" : "...",
"thumbnailURL" : "...",
"linkDescription" : "...",
"linkHost" : "..."
}
}
HTTP/1.1 201 Created
Content-Type: application/json
...
Create a new application post having as owner-application the token's owner (the IAM Client), note that the application must be registered on the Information System
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| media type | data type | description |
|---|---|---|
| application/json | PostInputBean (JSON) | The post to be written |
| code | condition |
|---|---|
| 200 | Successfull created, the new post is reported in the 'result' field of the returned object |
| 403 | "There is no application profile with such token |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) |
POST /2/posts/write-post-app
Content-Type: application/json
Accept: application/json
Authorization: ...
{
"text" : "Dear vre members, ...",
"preview_description" : "...",
"preview_host" : "...",
"preview_url" : "...",
"image_url" : "...",
"enable_notification" : true,
"params" : "...",
"previewtitle" : "..."
}
HTTP/1.1 200 OK
Content-Type: application/json
...
Create a new user post having as owner the auth token's owner
| name | type | description |
|---|---|---|
| Authorization | header | Bearer token, see https://dev.d4science.org/how-to-access-resources |
| Content-Type | header | application/json |
| media type | data type | description |
|---|---|---|
| application/json | PostInputBean (JSON) | The post to be written |
| code | condition |
|---|---|
| 201 | Successfull created, the new post is reported in the 'result' field of the returned object |
| 500 | The error is reported into the 'message' field of the returned object |
| media type | data type | description |
|---|---|---|
| application/json | object (JSON) |
POST /2/posts/write-post-user
Content-Type: application/json
Accept: application/json
Authorization: ...
{
"text" : "Dear vre members, ...",
"preview_description" : "...",
"preview_host" : "...",
"preview_url" : "...",
"image_url" : "...",
"enable_notification" : true,
"params" : "...",
"previewtitle" : "..."
}
HTTP/1.1 201 Created
Content-Type: application/json
...