Data Action Error

When creating a web service data action, i received this error:

JSON failed schema validation for the following reasons: Schema: # @/properties/status. Error location: /status. instance type (boolean) does not match any allowed primitive type (allowed: ["string"])

Does anyone can help em to solve this?

Regards

1 Like

Hi Andres,

Please post the configuration you are trying to use with anything sensitive redacted.

--Jason

1 Like

Hi Jason

This is the action im testing:

Input Contract
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "WhatsApp Out Quick Message",
"description": "Request to send Whatsapp template",
"type": "object",
"required": [
"apiKey",
"template",
"phone"
],
"properties": {
"apiKey": {
"description": "apikey",
"default": "xxxxxxxxxxxxxxxx",
"type": "string"
},
"template": {
"description": "Template name",
"type": "string"
},
"phone": {
"type": "string"
}
},
"additionalProperties": true
}

Output Contract
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "CampaignManagerResponse",
"description": "Should return a true or false and a message",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"msg": {
"type": "string"
}
},
"additionalProperties": true
}

1 Like

I updated a test action to use your input and output contracts without any problem. Next up is posting your action configuration (redacted as needed).

--Jason

1 Like

This action is used to request a external system to send a whatsapp business template from agent script action.

This request point to the external system url and use two headers as required:

content-type=application/json
accept=application/json

basically we send here a valid created template using: template and phone fields.

Let me know if i can share here url from external application and do some test, the issue is that we are receiving this warning after using this:

Even though the action is executed without any issue. if i do a test in my environment it shows this error:

JSON failed schema validation for the following reasons: Schema: # @/properties/status. Error location: /status. instance type (boolean) does not match any allowed primitive type (allowed: ["string"])

Hi Andres,

So I think that what that error is saying is that you have your output contract configured to have a "status" of type string, however the actual output of your data action has a "Status" of type bool.

Depending on your situation you either need to change your output contract to expect that to be a bool, or modify your success template to put double quotes around that value.

If that isn't enough to help you fix this I would recommend opening up a case with customer care as they can work with you interactively as well as looking at logs.

--Jason

1 Like

Hi Jason

This worked ok!

The problem was related to this "So I think that what that error is saying is that you have your output contract configured to have a "status" of type string, however the actual output of your data action has a "Status" of type bool."

Just changed it and it was processed ok.

1 Like

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