Example 1 - Simple “Posts” application
Schema
This is a simple representative schema for a PostgreSQL datasource, which has 4 objects (tables) - links, posts, topics, users - with relationships between these objects.
This schema is in the Neurelo Schema Language JSON specification
GET endpoint examples
Retrieve all posts
GET https://$ENV_API_URL/rest/postsRetrieve a specific post by id
GET https://$ENV_API_URL/rest/posts/3or
GET https://$ENV_API_URL/rest/posts?filter={"id":3}Retrieve a specific user
GET https://$ENV_API_URL/rest/users?filter={"first_name":"Jane", "last_name":"Doe"}Retrieve the first 5 posts
GET https://$ENV_API_URL/rest/posts?take=5Retrieve all users and their posts
GET https://$ENV_API_URL/rest/users?select={"$scalars": true, "posts": true}Retrieve user with id 3 and all their posts
GET https://$ENV_API_URL/rest/users/3?select={"$scalars": true, "posts": true}Retrieve specific user and all their posts
GET https://$ENV_API_URL/rest/users?select={"$scalars": true, "posts": true}&filter={"first_name":"Jane", "last_name":"Doe"}
POST endpoint examples
Create a new post
Create a new post, a new user, and link them to each other
Create a new user, 3 posts, link the posts to the user AND return the user scalars + related data (the 3 posts we just created)
PATCH endpoint examples
Update a post
Update a post and its linked user
DELETE endpoint examples
Delete a post
PreviousExamples of Neurelo Auto-Generated REST API endpointsNextExample 2 - "DVD Rentals" application
Last updated