Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
with the help of this community I succeed to call my first API "https://restcountries.eu/rest/v2/all" without any parameters.
I am now trying to call an API with parameters to provide ... and authorization from API owner
On https://developer.airfranceklm.com I asked for a key :
LE Open Data API: Default
Then, I find API documentation on https://developer.airfranceklm.com/docs/opendata/offers/
see attached "step20.PNG"
then, I implement a tRESTclient with
URL "https://api.airfranceklm.com/opendata/offers/reference-data"
GET
JSON
see attached "step21.PNG"
I have an error message
Exception in component tRESTClient_1 (Test_Service_API2)
javax.ws.rs.ServerErrorException: HTTP 596
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:544)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:904)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:866)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:431)
at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:611)
at servair_rim.test_service_api2_0_1.Test_Service_API2.tRESTClient_1Process(Test_Service_API2.java:837)
at servair_rim.test_service_api2_0_1.Test_Service_API2.tWarn_2Process(Test_Service_API2.java:3074)
at servair_rim.test_service_api2_0_1.Test_Service_API2.tWarn_1Process(Test_Service_API2.java:2940)
at servair_rim.test_service_api2_0_1.Test_Service_API2.runJobInTOS(Test_Service_API2.java:3308)
at servair_rim.test_service_api2_0_1.Test_Service_API2.main(Test_Service_API2.java:3157)
[statistics] disconnected
I found my error in the tREST ... most of API parameters have to be specified in the tab "Advanced Parameters" (header) and not in the first page "Simple Parameters" ...
There is more information in
https://developer.airfranceklm.com/developer_boot_camp
but I do not understand how to manipulate all these parameters ...
I adjusted some parameters following https://developer.airfranceklm.com/io-docs
but I know have error HTTP 403
Exception in component tRESTClient_1 (Test_Service_API2)
javax.ws.rs.ForbiddenException: HTTP 403 Forbidden
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:544)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:904)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:866)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:431)
at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:611)
at servair_rim.test_service_api2_0_1.Test_Service_API2.tRESTClient_1Process(Test_Service_API2.java:837)
at servair_rim.test_service_api2_0_1.Test_Service_API2.tWarn_2Process(Test_Service_API2.java:3074)
at servair_rim.test_service_api2_0_1.Test_Service_API2.tWarn_1Process(Test_Service_API2.java:2940)
at servair_rim.test_service_api2_0_1.Test_Service_API2.runJobInTOS(Test_Service_API2.java:3308)
at servair_rim.test_service_api2_0_1.Test_Service_API2.main(Test_Service_API2.java:3157)
[statistics] disconnected
I found my error in the tREST ... most of API parameters have to be specified in the tab "Advanced Parameters" (header) and not in the first page "Simple Parameters" ...