500 on historical data for 1 minute candle

Request:

Request {
    method: GET,
    url: Url {
        scheme: "https",
        cannot_be_a_base: false,
        username: "",
        password: None,
        host: Some(
            Domain(
                "api.upstox.com",
            ),
        ),
        port: None,
        path: "/v2/historical-candle/NSE_INDEX|Nifty%20Bank/1minute/2024-01-09",
        query: None,
        fragment: None,
    },
    headers: {
        "user-agent": "OpenAPI-Generator/v0/rust",
    },
}

Response

ResponseError(ResponseContent { status: 500, content: "{\"status\":\"error\",\"errors\":[{\"errorCode\":\"UDAPI100500\",\"message\":\"Something went wrong... please contact us\",\"propertyPath\":null,\"invalidValue\":null,\"error_code\":\"UDAPI100500\",\"property_path\":null,\"invalid_value\":null}]}", entity: Some(Status400(ApiGatewayErrorResponse { status: Some(Error), errors: Some([Problem { message: Some("Something went wrong... please contact us"), error_code: Some("UDAPI100500"), property_path: None, invalid_value: None }]) })) })

Could you attempt the following rephrased curl request? Your current request’s URL encoding appears to be incomplete.

curl --location 'https://api.upstox.com/v2/historical-candle/NSE_INDEX%7CNifty%20Bank/1minute/2024-01-09' \
--header 'Accept: application/json' 

To receive faster responses, consider posting in the Upstox API category at Upstox API Category.

That curl worked, so it looks like its the | thats not being encoded right?

Yes , the correct encoding for the string would be NSE_INDEX%7CNifty%20Bank

What URL encoding scheme are you using?

Standard URL Encoding: Encodes special characters and non-ASCII characters using the percent sign and two hexadecimal digits.