SAP API Business Hub Request Generator
The SAP API Business Hub lets you try released S/4HANA APIs against a sandbox before you touch a real tenant. This generator builds the matching cURL and HTTP requests so you can test calls, check payloads and copy the pattern into your own client.
Fill in
cURL
curl -X GET "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner?$top=5&$select=BusinessPartner,BusinessPartnerFullName,BusinessPartnerCategory&$filter=BusinessPartnerCategory%20eq%20%272%27&$format=json" \ -H "APIKey: YOUR_API_KEY" \ -H "Accept: application/json"
Raw HTTP
GET /s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner?$top=5&$select=BusinessPartner,BusinessPartnerFullName,BusinessPartnerCategory&$filter=BusinessPartnerCategory%20eq%20%272%27&$format=json HTTP/1.1 Host: sandbox.api.sap.com APIKey: YOUR_API_KEY Accept: application/json
Metadata call
curl -X GET "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/$metadata" \ -H "APIKey: YOUR_API_KEY" \ -H "Accept: application/xml"
Tenant call (replace APIKey with the tenant authentication)
curl -X GET "https://sandbox.api.sap.com/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner?$top=5" \ -H "Authorization: Bearer <access token>" \ -H "Accept: application/json"
The sandbox on SAP Business Accelerator Hub uses an APIKey header with your personal key from the API page, and returns sample data only. A real S/4HANA Cloud tenant uses its own host and OAuth or basic authentication through a communication arrangement, not the API key. Package paths and API names change, so confirm on the API reference page before you code.
Need help with SAP API integration?
Ask for a short conversation on connecting your SAP APIs to a private AI assistant with read-only access.
Optional. The tool and every export work without this. No spam.
How to use the generator
Pick the sandbox host to try an API with your key, or a tenant host for a real call. Enter the service path and entity set from the API reference page, add the query options and copy the cURL or HTTP block. Run it in a terminal or import it into a REST client to see the JSON response.
Sandbox versus a real tenant
The sandbox accepts an APIKey header and returns demo data, which is ideal for learning response shapes and writing mappings. A real S/4HANA Cloud tenant needs a communication scenario, communication system and communication user or OAuth client before an API can be called, and the host is specific to your tenant.
- Sandbox: APIKey header, sample data, rate limited
- Tenant: communication arrangement, OAuth or basic authentication
- Same OData service path, different host and security
- Test write calls only in non-production tenants
Reading the response
OData V2 responses wrap data in a d object, with a results array for collections. Use $select to keep payloads small and $top to limit rows. Use the $metadata output to confirm property names and key fields before you build mappings or write code against them.
Common mistakes
Using the sandbox key against a tenant host, forgetting to URL encode the filter, assuming sandbox data equals your data, and committing API keys to source control are frequent. Keep keys in environment variables and rotate them if they leak.
Frequently Asked Questions
What header does the SAP API Business Hub sandbox use?
The sandbox uses an APIKey header containing the personal key shown on the API page after you log in. The same key works across sandbox APIs, and it returns demo data only, not your own system data.
Can I use the sandbox key against my own S/4HANA Cloud system?
No. Your tenant uses its own host and authentication set up through a communication arrangement, with OAuth or basic authentication. The API Business Hub key is only for the shared sandbox.
How do I find the right service path?
Open the API reference page on the SAP Business Accelerator Hub, select the resource, and read the base path and entity sets shown there. For S/4HANA released APIs it normally starts with /sap/opu/odata/sap/.
Is it safe to share generated cURL commands?
Only after removing the API key or token. Treat keys like passwords, store them in environment variables, and never paste them into tickets or chat. Rotate the key if it was exposed.
If you want a private assistant that explains API payloads and drafts safe read calls against your SAP landscape, Netray can build one that runs in your environment.
Related Tools
SAP OData Service URL Builder
Generate a correct SAP Gateway OData V2 request URL with query options, test it in a browser or REST client, then reuse it in your code.
SAPSAP CPI iFlow Design Template
A fill-in design document for an SAP Cloud Integration iFlow, covering adapters, mappings, exception handling and monitoring, ready to hand to reviewers.
SAPSAP RFC Destination Setup Checklist (SM59)
Work through every step of creating and securing an RFC destination in SM59, from connection type to authorization and testing.
SAPIDoc to EDI X12 Mapping Worksheet (INVOIC to 810)
An editable mapping sheet that pairs IDoc segments and fields with X12 segments and elements, with rules and open questions, exported as an Excel spec.