Skip to main content

Person

Prerequisites #

  • To use the Social Feed API, you must first authenticate yourself and receive a token. See the Authentication documentation for more information on how to do this.
  • Person endpoints need a personId as path parameter. A person belongs to an organization, so check the organization and get personId. See the Organization documentation for more information on how to do this.

Requests #

Person resource provides the following endpoints:

PathHTTP MethodDescription
v1/persons/GETView All persons of current user's organization
v1/persons/{personId}GETView a specified person
v1/persons/{personId}PUTUpdate an existing person
v1/persons/{personId}DELDelete an existing person
v1/persons/{personId}/postsGETView All posts created by a specified person
v1/persons/{personId}/postsPOSTCreate a new post for a specified person
v1/persons/{personId}/posts/{postId}DELDelete an existing post
v1/persons/{personId}/posts/{postId}PUTUpdate an existing post content
v1/persons/{personId}/posts/{postId}GETView a specified post for a specified person
v1/persons/{personId}/posts/pagesGETView paginated posts of a specified organization
v1/persons/{personId}/posts/findPOSTView Information of specified list of post's ID
v1/persons/{personId}/posts/{postId}/likesPUTIncrease/decrease number of likes of a specified post
v1/persons/{personId}/posts/{postId}/commentsPOSTCreate a new comment of a specified post
v1/persons/{personId}/comments/{commentId}PUTUpdate an existing comment
v1/persons/{personId}/comments/{commentId}DELDelete an existing comment
v1/persons/{personId}/comments/{commentId}/likesPUTIncrease/decrease number of likes of a specified comment

See the API documentation documentation for more information on these endpoints

Example Request #

The following example curl command demonstrates how to create a new post for a specified person.

curl -i "https://sf-dev.microservice.bankify.io/v1/persons/<personId>/posts"
-H "Authorization: Bearer <access_token>"
-d "{ \"postContent\": \"<your-post-Content>\"}"

Responses #

  • If successful, the operation responds with HTTP status code 2XX.
  • If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.
    • If the specified person (gets or) updates post or comments of another person, the operation returns the Access is denied error.
    • If the specified person does not belong to the authenticating user organization, the operation returns the Access is denied error.
    • If the authenticating user or the specified person, post, category and comment does not exist, the operation returns the Not found error.
    • If the specified person likes a post or comment for more than one time, the operation returns the Conflict error.
    • If the Authorization header is not present or invalid, a 401 error code will be returned.