RealComposer
Frontend / WebREST APIMulti-API Aggregation

Call Two REST Apis in Parallel and Return Merged Payload

One edge call merges REST API for Frontend / Web

Direct Answer & Architecture Summary

To call two rest apis in parallel and return merged payload, configure parallel steps for REST API. Frontend / Web performs one authorized GET/POST to RealComposer and receives a merged payload.

Security LevelAES-256-GCM Vault
Edge LatencySub-10ms Response
InfrastructureZero Server Maintenance
The Problem Solved

Serial REST API calls slow Frontend / Web pages

Each extra REST API hop adds hundreds of milliseconds and another OAuth refresh path your UI must manage.

Critical Security & Operational Risks:
  • One slow upstream blocking an entire page
  • Partial failures leaving UI in inconsistent states
  • Duplicate auth refresh logic per service
Architecture & Step-by-Step Implementation

How RealComposer Solves This at the Edge

1

Add vault secrets for this pipeline

Create API_BEARER_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.

2

Target the real upstream URL

Use GET against https://jsonplaceholder.typicode.com/posts/1. Allowed origins on the client token should match leave cache ttl at 0 when each response is user-specific (include userid or record id in query params before enabling cache).

3

Call from Frontend / Web

Allowed origins on the token should list every Frontend / Web host that calls this URL.

                    const res = await fetch('https://realcomposer.com/v1/workspace/parallel-api-fetch-merge-payload', {
  headers: { Authorization: 'Bearer rc_live_your_token' }
});
                  
Payload Slimming Comparison
64% Bandwidth Reduction
Raw Upstream Response251 B
              {
  "requestId": "req_parallel",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "parallel-api-fetch-merge-payload"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
            
RealComposer Slimmed Edge Payload91 B
              {
  "posts_userId": "sample",
  "posts_name": "sample",
  "user_userId": "sample",
  "user_name": "sample"
}
            

Recipe Specs

HTTP method
GET
Upstream calls
2
Edge cache TTL
No caching
Client auth
Restricted client token
Mapped output fields
4
Payload
251 B to 91 B (-64%)
Call from Terminal or Client
curl -X GET "https://realcomposer.com/v1/workspace/parallel-api-fetch-merge-payload" \
  -H "Authorization: Bearer rc_live_client_token"
Frequently Asked Questions

Developer Questions & Troubleshooting

What should Frontend / Web store instead of REST API secrets?

Yes for parallel-api-fetch-merge-payload. Ship only an rc_live_ client token in Frontend / Web; RealComposer injects API_BEARER_TOKEN on https://jsonplaceholder.typicode.com/posts/1.

Will Anthropic or Linear prompt bodies be rewritten?

parallel-api-fetch-merge-payload forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates.

Can I restrict which domains call this pipeline?

Rotate vault secrets for parallel-api-fetch-merge-payload anytime; clients keep the same rc_live_ token.

Sources & Definitions Used in This Answer

Instant Deployment

Deploy this Frontend / Web + REST API Recipe

Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.

CLONE THIS RECIPE
Related Architecture Recipes