Resources API Request and Response
Authentication
The Resources API requires authentication for all requests. For detailed information about authentication methods and requirements, please see the Authentication section of the API documentation.
Required Headers
All requests to the Resources API must include the following headers:
| Header | Description | Required | Example |
|---|---|---|---|
X-Spaaza-Chain-ID | Numeric Chain ID for the request | Yes | 1743 |
X-Spaaza-API-version | API version (minimum 1.6.1) | Yes | 1.6.1 |
X-Spaaza-Session-User-ID | User ID for authentication | Yes | {your user ID} |
X-Spaaza-Session-Key | Session key for authentication | Yes | {your key} |
X-Spaaza-Response-Recursion-Level | Response detail level (0-4, default 3) | Optional | 3 |
Content-Type | Content type for POST/PATCH/PUT requests | For POST/PATCH | application/json |
Responses
Resources API endpoints return payloads in JSON format as follows:
- Single Resource Retrieval: Returns a JSON object representing the resource in accordance with the OpenAPI specification of the resource.
- Multiple Resource Retrieval: Returns a JSON object containing an array of resources along with pagination metadata.
For more detailed information about API response formats, status codes, and data structures, please see the Responses section of the API documentation.
Response Recursion Levels
The Resources API supports configurable response detail levels through the X-Spaaza-Response-Recursion-Level header.
This controls how much detail is included in API responses, particularly for nested objects and relationships.
Recursion Level Values
- Level 0: Minimal response with only basic identifiers
- Level 1: Basic properties without nested objects
- Level 2: Includes some nested object properties
- Level 3: Default level with comprehensive property details
- Level 4: Maximum detail including all available properties
Usage
Include the X-Spaaza-Response-Recursion-Level header in your requests to specify the desired detail level:
curl -X GET https://api0.spaaza.com/resources/{resource name}/{id} \
-H "X-Spaaza-Response-Recursion-Level: 2" \
# ... other headers
Note that, in the case of nested resources, the recursion level applies recursively to related resources as well and the remaining recursion level value is "carried" down the object tree. For example, if you request recursion level 3 for a resource, Resource 1, and a nested resource in Resource 1 has a recursion level of 2, then that nested resource will be returned with recursion level of (3 - 2 = 1).
If not specified, the default recursion level of 3 is used.
Versioning
For information about API versioning and version compatibility, please see the Versioning section of the API documentation.
Error and Warning Codes
For a complete list of error codes, warning codes, and troubleshooting information, please see the Error and Warning Codes section of the API documentation.