cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP CPI API Message Processing Logs

ybuc
Explorer
0 Likes
6,445

Good afternoon,

I'm really not a SAP person and I'm my target is to download some MPL data from the current existing API.
https://api.sap.com/api/MessageProcessingLogs/resource/Logs

My problem is not about the API it's self but it is how to authorize my self to reach the API.

Do I need any APIKey with read grants or do I need to authenticate with user and password?

If any APIKey is needed, where is the piece of document from SAP CPI that explain that?


In previous experience (with other platforms) I was generating a Api token and that was good enough to read data from the API

Thank you to anybody who can help me here

Accepted Solutions (1)

Accepted Solutions (1)

OlgenH
Participant
0 Likes

Hi Yann

the documentation link that you have provided lists the authentication method as basic authorisation which would work but of course it is not the best way. If you use this approach your user will need role the MonitoringDataRead to be assigned in SAP BTP

There is another link in the page you have found which explains how to setup an OAuth client in SAP BTP. This is the recommended approach.

https://help.sap.com/docs/cloud-integration/sap-cloud-integration/message-processing-logs?locale=en-...

If you don't have access to SAP BTP an admin has to create a service key (which contains client id/client secret and token endpoint) in the subaccount where CPI is deployed.

Kind regards

Olgen

Answers (1)

Answers (1)

ybuc
Explorer
0 Likes

I appreciate your help in this matter and I thank you for the time you spent in answering me.
I was able to successfully call retrieve data from the following API, also thanks to a colleagues.

I'd like to take this moment to ask another question which will be out topic:

My basic goal is to retrieve Messages logs every N minutes (for the last N minutes).

I'd like to do that without extracting duplicates Messages logs. In your experience, is there a filter included in the API which will guarantee that each time I execute the API call, I do extract a different batch of Messages Logs?


Your solution have been accepted, thank you

OlgenH
Participant
0 Likes

Hi Yann, you're most welcome!

Unfortunately there is no filter you can use in the API for your requirement. Also, because OData is stateless the provider won't know what was served in the previous call and return only the delta in the successive call.

You'll have to build this on the client side by persisting the last execution time and using it as a query.

Something like 'EndLog > LastExecutionTime and EndLog < CurrentTime'

Kind regards