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
  • Usage
  • Returns
  • Example
  • Best Practices
  • Supported Status Code
  1. Flow Builder
  2. Node Types
  3. Trigger Nodes

HTTP Response

PreviousTrigger NodesNextConditional Nodes

Last updated 9 months ago

The HTTP Response node is designed to send a response back to the client in an API flow. It's essential for completing the request-response cycle in web applications, allowing you to specify the status code and body content of the response. This ensures that the client receives the necessary information after processing a request.

Field

Description

Required

Default

Node name

true

-

Response value

Content to be sent back in the response body

false

-

Response status code

HTTP status code for the response

true

-

Usage

  1. Specify the response value. The previous value of node can be used here via .

  2. Select the appropriate response status code from the dropdown menu.

Returns

This node sends an HTTP response to the client.

Example

Let's say you want to send list of users stored in the database.

  1. You've used to fetch the users and now you can set the response value as $.listRecords.result .

  2. Set the status code as 200 - OK.

After the calling the API, you'll receive the list of users in the response body with status code as 200.

Best Practices

Supported Status Code

Status Code

Meaning

Use Case

200

OK

Successful request (GET, PUT, PATCH)

201

Created

Successful resource creation (POST)

202

Accepted

Request accepted, but processing not completed

204

No Content

Successful request with no content to return (DELETE)

400

Bad Request

Invalid input, missing required fields

401

Unauthorized

Missing or invalid authentication token

403

Forbidden

User doesn't have necessary permissions

404

Not Found

Requested resource doesn't exist

409

Conflict

Request conflicts with current state of the server

500

Internal Server Error

Unexpected condition on the server

Choose appropriate status code for different scenarios. For example, 200 for Successful Request, 201 for Resource Created Successfully, 400 for Invalid Request from Client. For more information, you can refer this document from MDN.

Magical Autocomplete
List Records
HTTP response status code
Node name