Cosmocloud Build Documentation
DocumentationTutorials
  • Welcome to Cosmocloud
  • Getting Started
    • 1. Organisations
    • 2. Projects
    • 3. Connect your Database
    • 4. Create Database Models
    • 5. Create APIs
    • 6. Testing Free Tier APIs
  • Free Tier
    • Connecting with MongoDB Data APIs
  • Templates
    • CRUD APIs
    • Entity Search APIs
    • Fetch / Upload Media APIs
  • Examples - How To?
    • Making an external API call
    • Reusable Flows - SubFlows
    • Creating Custom Error Responses
    • Flow Builder - Building Conditional Logics
    • Flow Builder - Utilising Loops
    • Creating Dynamic Queries
    • Accessing Auth Tokens in APIs
    • How to upload/download media in Object Storage
  • Resources
    • APIs
      • Checking Logs
    • SubFlows
    • Models
      • Building Models
    • Environments
      • Environment Tier Types
    • Secrets
      • Custom Secrets
    • Databases
    • Releases
    • Vector Search
      • Create a Vector Search Index
      • Edit a Vector Search Index
      • Delete a Vector Search Index
    • Document Search
      • Full Text Search
        • Concepts
          • Indexing in full-text search
          • Data processing using Analyzers
        • Create a Search Index
        • Creating a Custom Analyzer
        • Full Text Search FAQ
      • Vector Search
    • Object Storage
  • Flow Builder
    • Node Types
      • Trigger Nodes
        • HTTP Response
      • Conditional Nodes
        • If Else
        • If Else V2
        • Switch Case
      • Crypto Nodes
        • PBKDF2 Hmac Hash
      • Debug Node
      • Database Nodes
        • Delete One
        • Delete Many
        • Fetch By ID
        • Find One
        • Find Many
        • Insert One
        • Insert Many
        • List Records
        • Run Aggregation Pipeline
        • Update One
        • Update by ID
        • Update Many
      • External Nodes
        • Fire Events (SQS)
        • API Call
        • Delete storage objects
        • Execute SubFlow
        • Get Presigned URL
        • Post Presigned URL
        • Send EMAIL (SES)
        • Send SMS (SNS)
      • Loop Nodes
        • For loop
        • While loop
      • Variable Nodes
        • Arrays
          • Append array
          • Contains
          • Check array empty
          • Extend array
          • Get Array Item
          • Length of array
          • Reverse array
          • Sort array
        • Date and Time
          • Set current datetime
        • Strings
          • Append String
          • Concat Strings
          • Convert to String
          • Length of String
          • Slice String
          • Split String
          • String Operations
          • To Lower
          • To Upper
          • Trim String
        • Mathematical
          • Add Variable
          • Complex Math Expr
          • Decrement Variable
          • Divide Variable
          • Increment Variable
          • Multiply Variable
          • Subtract Variable
        • JSON
          • Build JSON Object
          • Merge JSON Objects
          • Object to String
          • Update JSON Object
        • Special
          • Build Map
          • Set Variable
          • Exists Check
    • Node name
    • CQL - Cosmocloud Query Language
      • Building Expressions
        • $abs
        • $add
        • $addDate
        • $arrayElemAt
        • $avg
        • $buildDateTime
        • $buildMap
        • $ceil
        • $cond
        • $divide
        • $floor
        • $getDay
        • $getHour
        • $getMinute
        • $getMonth
        • $getSecond
        • $getYear
        • $ifNull
        • $max
        • $min
        • $mod
        • $multiply
        • $pow
        • $subtract
        • $sqrt
      • Building Conditions
        • Compound Operators
          • $and
          • $or
        • Conditional Operators
          • $eq
          • $gt
          • $gte
          • $lt
          • $lte
          • $neq
      • Magical Autocomplete
  • Advanced Guide
    • Configuring Authentication
      • SSO Providers
        • AWS Cognito
      • Authentication Concepts
    • MongoDB Query Language
      • Limitations
    • Performance Considerations
      • Instant Deployments
  • User Management
  • Billing and Payments
    • Billing Portal
  • Help & Support
  • References
    • Change log
    • Available Cloud & Regions
Powered by GitBook
On this page
  • Steps to create CRUD APIs from Template
  • GET
  • GET BY ID
  • POST
  • PUT
  • PATCH
  • DELETE
  1. Templates

CRUD APIs

PreviousTemplatesNextEntity Search APIs

Last updated 9 months ago

This powerful feature allows users to effortlessly create basic CRUD (Create, Read, Update, Delete) APIs for any database model. This functionality enables users to quickly generate endpoints to manage their data models without needing to write extensive code. By streamlining the development process, it allows for rapid setup and efficient management of data operations, saving time and reducing complexity for developers.

Steps to create CRUD APIs from Template

  • Navigate to the APIs listing page from Application Layer -> APIs.

  • Click on the Create API button on the top right corner.

  • Select the Browse Template option from the dialogue box.

  • Select the Entity CRUD APIs option.

  • Enter the Database collection.

  • Select the APIs to be created.

  • Accordingly the Models to be created.

  • Click on finish to generate the starter APIs and models.

You can then customise and edit any APIs that are created via Templates

The starter template that Cosmocloud provides contains six APIs and five models.

Initially, APIs and models will be created in ‘Draft’ state. You can edit them in the Workflow builder to add more customisations.

GET

  • This method allows you to retrieves a list of all items in the database.

  • This method also supports pagination through limit and offset parameters.

    • Limit: Specifies the maximum number of items to be returned in a single request.

    • Offset: Specifies the number of items to skip before starting to collect the result set.

GET BY ID

  • This method retrieves a specific item's details based on the provided ID.

  • It requires the ID as a parameter to identify the item.

  • It returns detailed information about the item, including all relevant fields stored in the database.

POST

  • This method allows the creation of a new item in the database.

  • It requires item details to be provided in the request body.

  • It validates the provided data to ensure it meets the required criteria before creating the item.

  • It returns the ID of the newly created item.

PUT

  • This method allows to replace the existing item in the database with new item.

  • It requires the item ID to identify the specific item to be replaced.

  • It requires item details to be provided in the request body.

  • It validates the provided data to ensure it meets the required criteria before creating the item.

PATCH

  • This method allows partial updates to an existing item in the database.

  • This method requires the item ID to identify the specific item to be modified.

  • It requires only the fields to be updated to be provided in the request body, allowing for partial changes without affecting the entire item.

  • It validates the provided data to ensure it meets the required criteria before applying the updates.

DELETE

  • This method allows the removal of an existing item from the database.

  • It requires the item ID to identify the specific item to be deleted.

  • It permanently deletes the specified item from the database.

  • It returns a confirmation message indicating the successful deletion of the item.

How to customise APIs