Back to Strategies API Documentation

User Strategies Endpoint

GET .../api/v0/strategies/<user>

This endpoint retrieves user strategies from S3. The strategies are returned as JSON data exactly as stored in S3.

Authentication

This endpoint requires authentication using a Bearer token:

Authorization: Bearer <your_customer_token>

Parameters

Parameter Type Location Required Description
user String URL Path Yes User identifier used as folder name in S3
idretailer String Query String Yes Retailer identifier

Request Format

The request is a simple GET request with the user in the URL path and retailer ID as a query parameter:

GET /api/v0/strategies/<user>?idretailer=<retailer_id> Authorization: Bearer <your_token>

Response Format

Success Response (200 OK)

The response contains the JSON data from S3 as-is (structure depends on the stored data):

{ // JSON data from S3 file }

Error Responses

Authentication Error (401 Unauthorized)

{ "detail": "Authentication credentials were not provided." }

Missing Parameter (400 Bad Request)

{ "error": "Missing 'user' parameter in URL path." }

or

{ "error": "Missing 'retailer_id' parameter in query string." }

Not Found (500 Internal Server Error)

{ "error": "No models found for user: <user>" }

Example Usage

Here's an example of how to use this endpoint with curl:

curl -X GET \ "https://api.ravenwits.com/api/v0/strategies/example_user?idretailer=123" \ -H "Authorization: Bearer your_token_here"