Gayatri,
Unfortunately, the ReltioApi
interface, doesn't allow us to pass request headers to the API calls. So, we solved this problem in one of the implementations, by writing a custom RestClient class, which can call REST APIs with request headers and other relevant parameters. You can follow a similar process for your use case as well.
------------------------------
Diparnab Dey
Technical Consultant
Reltio
Kolkata, West Bengal
------------------------------
Original Message:
Sent: 09-30-2024 05:36
From: Gayatri Khatale
Subject: Not able to pass "Environment URL" as a request header in to invokeAPI() method
Hi,
1. We are trying to manually start a process instance by calling an API in our Java code. We have implemented the ReltioApi
interface in our Java class, and the method we are using to call the Start Process Instance API is as follows:
String invokeApi(String accessToken, String url, String requestMethod, String requestBody)
2. We are trying to call the following API using this method:
curl --location 'https://localhost:8443/workflow-adapter/workflow/{tenantid}/processInstances/' \
--header 'EnvironmentURL: https://test23-usg.reltio.com' \
--header 'Authorization: Bearer <access token>' \
--header 'Content-Type: application/json' \
--data '{
"objectURIs": [
"changeRequests/2V3lzMg",
"entities/0SZfrbt"
],
"processType": "DepartmentAReview"
}'
3. However, as shown in the invokeApi
method, there is no parameter to pass the EnvironmentURL
header. How should we handle this issue?
Thank you!
------------------------------
Gayatri Khatale
Blue Altair
Pune
------------------------------