Agent Studio Issue with Session Variable

Hi,

I am having an issue with agent studio whereby I cannot seem to provide my session variable in my request.

Here’s the request I am making:

{"userInput":{"text":"Yo"},"parameterInputs":{"questionnaireId":"c2e67dea-8678-435e-9bdb-ad702b0a62bf"}}

Here’s the response:

{
    "errorCode": "INVALID_ARGUMENT",
    "errorName": "Conjure:UnprocessableEntity",
    "errorInstanceId": "856032cb-857c-448e-9ab1-46653aa3553e",
    "parameters": {}
}

This image is how it looks in the editor!

Not sure whether I’ve simply used the syntax incorrectly or whether there is something else :slight_smile:

Actually, me being a bit slow here…

You just need to add the type in the call!

{"userInput":{"text":"Hi!"},"parameterInputs":{"questionnaireId":{"type":"string","value":"c2e67dea-8678-435e-9bdb-ad702b0a62bf"}}}

Hey @jackmiller2003

Yes the second request body is correct here! The values for the parameterInputs field use the ParameterValue union type (see API reference here), which requires specifying if the parameter is a string or objectSet type.

You can find an example for passing an objectSet variable in the docs here, copying over for reference:

  • Request body with objectSet variable
{"userInput":{"text":"What is the status of my order?"},"parameterInputs":{"currentCustomerOrders":{"type":"objectSet","ontology":"example-ontology","objectSet":{"type":"filter","objectSet":{"type":"base","objectType":"customerOrder"},"where":{"type":"eq","field":"customerId","value":"123abc"}}}}}
  • Request body with string variable
{"userInput":{"text":"What is the status of my order?"},"parameterInputs":{"customerId":{"type":"string","value":"123abc"}}

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.