Replies: 1 comment
-
|
The 400 error happens because the DELETE /conversations/{conversation_id} endpoint does not expect a request body—sending any data (like your {'user': ...} payload) will cause this error. The API only needs the conversation ID in the URL and the correct Authorization header (Bearer token) for authentication. To fix this, remove the data argument from your request. Here’s how you should call it: def delete_conversation(
self,
api_key: str,
base_url: str,
conversation_id: str,
) -> Tuple[bool, Dict]:
endpoint = f'/v1/conversations/{conversation_id}'
return self._make_request(
method='DELETE',
endpoint=endpoint,
api_key=api_key,
base_url=base_url,
data=None # or just omit this argument entirely
)Make sure your _make_request method does not send a body for DELETE requests. Only include the Authorization header and the correct endpoint URL. This matches the API’s requirements and will resolve the 400 error you’re seeing (source). To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
this API does not work , why?
400 - The browser (or proxy) sent a request that this server could not understand. (错误码: bad_request)
@dosu.
2. Additional context or comments
No response
Beta Was this translation helpful? Give feedback.
All reactions