on 04-10-2018 11:16 PM
Experts-
I have a question regarding consuming API into SAP cloud platform integration services to build iflows. I have the information of the API and API key for a user. I am not seeing any option in integration services to call the API directly using the API key like we do in POSTMAN client. I know API management is an option in SAP cloud platform but am not sure how to leverage the same. I know if we can create OData, REST and SOAP services the same can be consumed using API management but not sure the other way. Please, it would be appreciated if anyone can share the experience or taught on this issue.
Please let me know.
Regards
HS
Hi Hari
I'm assuming you need to pass your API key along to the service in either a query parameter or a header, and both are definitely doable in Cloud Integration.
Regards,
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hari
A header can be added with a Content Modifier step. A query parameter can be added directly to the configuration of the service's receiver channel. If you have the API key in a property called MyAPIKey, you can add it to a query parameter called apikey as follows:
apikey=${property.MyAPIKey}
Regards,
Morten
I apologize for the delay. I wanted to provide you with a real example.I have following URL. In this request, we need to send the DSN which is system and also the key. If am using the content modifier step. I will have the following settings.
message.Header = Content-Type,application/json
message.Header = Accept,application/json
message. Property = apikey,c4QMMWnX7WbQrXVtlRgldWJBF0fKVqr3
After this am not sure what will be my URL and Query if am doing POST and GET. Please it will be appreciated if you can help me with this issue.
Thanks
HS
Thanks for the quick reply. I need to send request data to the service which can be sent in content modifier is that correct? The way the service works is you need to send a request data to get the response. I did following configuration in the content modifier. I am passing following query In content modifier.
Please let me know.
Thanks
HS
{"header":{"ver":1,"src_sys_type":2,"src_sys_name":"testing","archtics_version":"V999"},"command1":{"cmd":"ats_ext_test_polling","uid":"user99","dsn":"apigee"}}
I am receiving 401 error. It is saying invalid API key but the same is working fine using POSTMAN. Please let me know if you have any ideas to resolve this error.
I do really appreciate your help.
Regards
HS
Duration 444 ms Error org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://app.ticketmaster.com/sth-customer/ticketing_services.aspx?dsn=apigee≈ikey= with statusCode: 401KeyValueDescriptionProcessing exchange ID-vsa3471622-53088-1523743031491-151-2 in ahc:https://app.ticketmaster.com/sth-customer/ticketing_services.aspx?clientConfig=#clientConfig_Receiver_HTTP&binding=#binding_Receiver_HTTP&clientConfig.requestTimeoutInMs=60000&clientConfig.idleConnectionInPoolTimeoutInMs=60000&clientConfig.idleConnectionTimeoutInMs=60000&clientConfig.connectTimeout=10000RealDestinationUrlhttps://app.ticketmaster.com/sth-customer/ticketing_services.aspx?dsn=apigee≈ikey=ResponseBody{"fault":{"faultstring":"Invalid ApiKey","detail":{"errorcode":"oauth.v2.InvalidApiKey"}}}HTTPRequestHeadersContent-Type: application/json SAP_MessageProcessingLogID: AFrhCYUs1TyThERDDmnQvPngne3a SAP_MplCorrelationId: AFrhCYXE_YcGc5dJv2ifP_BxxE6z SAP_PregeneratedMplId: AFrhCYXqV0qLzdqMsaMVbj5oMMOHHTTPResponseHeadersConnection: keep-alive Content-Length: 90 Content-Type: application/json Date: Wed, 25 Apr 2018 23:04:37 GMTHTTPStatusCodeI tried the ping but still the same result. Please let me know.
Thanks
HS
Duration 448 ms Error org.apache.camel.component.ahc.AhcOperationFailedException: HTTP operation failed invoking https://app.ticketmaster.com/sth-customer/ticketing_services.aspx?dsn=apigee≈ikey= with statusCode: 401 KeyValueDescriptionProcessing exchange ID-vsa3471622-53088-1523743031491-152-2 in ahc:https://app.ticketmaster.com/sth-customer/ticketing_services.aspx?clientConfig=#clientConfig_Receiver_HTTP&binding=#binding_Receiver_HTTP&clientConfig.requestTimeoutInMs=60000&clientConfig.idleConnectionInPoolTimeoutInMs=60000&clientConfig.idleConnectionTimeoutInMs=60000&clientConfig.connectTimeout=10000RealDestinationUrlhttps://app.ticketmaster.com/sth-customer/ticketing_services.aspx?dsn=apigee≈ikey=ResponseBody{"fault":{"faultstring":"Invalid ApiKey","detail":{"errorcode":"oauth.v2.InvalidApiKey"}}}HTTPRequestHeadersContent-Type: application/json SAP_MessageProcessingLogID: AFrhDSoAivsm5MoQFHsvbt44UxkD SAP_MplCorrelationId: AFrhDSryu2iXm8KkFqmN0wyPVYys SAP_PregeneratedMplId: AFrhDSoSTXKEZ8EQuAjrbGnDvnGsHTTPResponseHeadersConnection: keep-alive Content-Length: 90 Content-Type: application/json Date: Wed, 25 Apr 2018 23:20:11 GMTHTTPStatusCodeUser | Count |
---|---|
77 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.