For a deeper look into our World Check One API, look into:

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
Accepted
56 0 5 8

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"
    }

}


#technologyworldcheck-one-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvotes
Accepted
1.1k 2 2 3

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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
56 0 5 8

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!



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1.1k 2 2 3

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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.