Provider type not accepted

When sending a request for creating multiple cases using /saveAndScreen i get:
400 Bad Request: "[{"error":"INVALID_PROVIDER_TYPE","cause":"Provider types are invalid and must include at least WATCHLIST."}]"

What is wrong with the request?

Request body:

{
"groupId":"5jb6u0gde8tu1fkacjta3o9p7",
"providerTypes":[
"WATCHLIST"
],
"cases":[
{
"caseId":null,
"entityType":"VESSEL",
"name":"ABAN II",
"customFields":[
{
"typeId":"5jb7m2seyqae1hmr59e00gpkx",
"value":"8750015",
"fieldValueType":"TEXT",
"regExp":null,
"fieldRequired":false,
"label":"vesselId"
}
],
"secondaryFields":[
]
}
],
"nameTransposition":false,
"caseScreeningState":{
"watchlist":"INITIAL"
}

}


Best Answer

  • Hello @eirik.yksnoy, thank you for reaching out to us! Kindly look at the request body schema within the API endpoint Save and screen multiple cases (also seen in our WC1 API documentation).

    {
        "groupId": "{{group-id}}",
        "providerTypes": [
            "WATCHLIST"
        ],
        "nameTransposition": false,
        "caseScreeningState": {
            "WATCHLIST": "INITIAL"
        },
        "cases": [
            {
                "entityType": "ORGANISATION",
                "name": "Stark Enterprise"
            },
            {
                "entityType": "INDIVIDUAL",
                "name": "Tony Stark",
                "secondaryFields": [
                    {
                        "typeId": "SFCT_1",
                        "value": "MALE"
                    },
                    {
                        "typeId": "SFCT_2",
                        "dateTimeValue": "1980-01-18"
                    },
                    {
                        "typeId": "SFCT_3",
                        "value": "USA"
                    },
                    {
                        "typeId": "SFCT_4",
                        "value": "AUS"
                    },
                    {
                        "typeId": "SFCT_5",
                        "value": "ABW"
                    }
                ],
                "customFields": [
                    {
                        "typeId": "{{custom-field-1}}",
                        "value": "custom field 1 sample value"
                    },
                    {
                        "typeId": "{{custom-field-2}}",
                        "value": "custom field 2 sample value"
                    },
                    {
                        "typeId": "{{custom-field-3}}",
                        "value": "mandatory custom field sample value"
                    }
                ]
            },
            {
                "entityType": "INDIVIDUAL",
                "name": "Dr. Stephen Strange"
            },
            {
                "entityType": "VESSEL",
                "name": "The Black Pearl",
                "secondaryFields": [
                    {
                        "typeId": "SFCT_7",
                        "value": "9362059"
                    }
                ]
            }
        ]
    }

    When you compare your request body with the one above, the attribute within "caseScreeningState" called "WATCHLIST" is completely capitalized, while your attribute within "caseScreeningState" is not capitalized. This causes you to get a 400 error.

    It is very important to always make sure you follow the request body schema because it is your guide to getting a successful response.

    Kindly fix your request body and let me know if you are able to get a successful response. Thank you.

    Blessings,

    Judith

Answers

  • Hi @judith.pillado.lseg


    The cause was the lowercase watchlist field. We are using Java/Spring Boot and the class CaseScreeningState has a field called watchlist. This field was always lowercase in the json payload. It was fixed by adding @JsonProperty("WATCHLIST") to the field.


    Thank you!



  • Hello @eirik.yksnoy - thank you for the update and I am glad everything is working out smoothly for you now! Let me know if you need anything else.

    Blessings,

    Judith