Hi,
I am trying to add connector attributes to an existing source using the update-source | SailPoint Developer Community api in Java. I managed to get this right in postman but the same request returns Response{protocol=h2, code=400, message=, url=https://<TENANT>.api.identitynow.com/v3/sources/<sourceId>}
in my code. According to the documentation, this error is returned if the request body is invalid.
Below is a sample of my code, please assist.
Map<String, Object> thisMap = new HashMap<>();
thisMap.put("op", "add");
thisMap.put("path", "/connectorAttributes/supportUnstructuredData");
thisMap.put("value", true);
listAttributes.add(thisMap);
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String attributesAsString = gson.toJson(listAttributes);
I then pass the attributesAsString to a function that executes the below
@PATCH("v3/sources/{sourceId}")
@Headers("Content-Type: application/json-patch+json")
Call<Source> patchConnectorAttributes(
@Path("sourceId") String sourceId,
@Body String connectorAttributes
);
I intercepted the request to print out the request body it displays : Request Body: "[\n {\n \"op\": \"add\",\n \"path\": \"/connectorAttributes/supportUnstructuredData\",\n \"value\": true\n }\n]"
which I thought would work, but alas.
I would appreciate any assistance regarding the issue, thank you in advance.