API Tries not working

Hey I am currently testing some API Call to discover Dust ! Which looks cool

But I got many 400 status. For example when trying to create a conversation, I put my workspace ID in the right place + bearer id above the code snippets, and then hit the Try It button, but it doesnt work.

Error :
{
“error”: {
“type”: “invalid_request_error”,
“message”: “Invalid request body: Expecting string at 0.title.0 but instead got: undefined,Expecting null at 0.title.1 but instead got: undefined,Expecting “unlisted” at 0.visibility.0 but instead got: undefined,Expecting “workspace” at 0.visibility.1 but instead got: undefined,Expecting “deleted” at 0.visibility.2 but instead got: undefined,Expecting “test” at 0.visibility.3 but instead got: undefined”
}
}

And when I use the “Request example” it still shows up an error

{
“error”: {
“type”: “invalid_request_error”,
“message”: “Invalid request body: Expecting “slack” at 0.message.0.0.context.origin.0 but instead got: “string”,Expecting “web” at 0.message.0.0.context.origin.1 but instead got: “string”,Expecting “api” at 0.message.0.0.context.origin.2 but instead got: “string”,Expecting null at 0.message.0.0.context.origin.3 but instead got: “string”,Expecting undefined at 0.message.0.0.context.origin.4 but instead got: “string”,Expecting Timezone at 0.message.0.0.context.timezone but instead got: “string”,Expecting undefined at 0.message.1 but instead got: {“content”:“This is my message”,“mentions”:[{“configurationId”:“dust”}],“context”:{“username”:“string”,“timezone”:“string”,“fullName”:“string”,“email”:“string”,“profilePictureUrl”:“string”,“origin”:“string”}},Expecting “unlisted” at 0.visibility.0 but instead got: “private”,Expecting “workspace” at 0.visibility.1 but instead got: “private”,Expecting “deleted” at 0.visibility.2 but instead got: “private”,Expecting “test” at 0.visibility.3 but instead got: “private””
}
}

Thanks for the help :smiley:

Fyi : list assistants request is working well - so my Bearer key & workspace id are right

1 Like

Ok it seems like I understood that I had to replace the “string” everywhere they were. I thought “Request example” would automatically replace them ! No problem then

Hi,
Yes you need to replace by using actual values, the example is just giving you the structure of the data you need to send.

You can actually use the input fields in the documentation in the “BODY PARAMS” section, they will fill the data at the right place.

Let us know if you ended up making it work :slight_smile:

Sure it worked now thanks :grin: