cancel
Showing results for 
Search instead for 
Did you mean: 

SAPCAI + ABAP + Request can not be processed with your role

ipravir
Active Contributor
0 Kudos

Hi,

I am trying to access created bot using ABAP API

Try Out | Bot Connector API | SAP API Business Hub

However getting below response message.

Is this due to trial account or some where I need to maintain role.

Regards,

Praveer

Accepted Solutions (1)

Accepted Solutions (1)

JonasB
Contributor
0 Kudos

Hi Praveer,

most likely this error just means that you did not pass the authentication correctly.

Are you passing an Authorization header with a designtime OAuth token?

Regards
Jonas

ipravir
Active Contributor
0 Kudos

Hi jonas.brand ,

Thanks for the hint, now I am receiving response.

One more question, is there any way to send message using API and receive respective message response from bot.

I was checking "message" API, not sure, is it for fetching old message or can I post a new message to get response from bot.

Please suggest.

Best Regards,

Praveer.

JonasB
Contributor

Hi Praveer,

that’s what the dialog endpoint is intended for - especially for use cases where you don’t use one of the channels provided by SAP Conversational AI but build your own:

https://api.sap.com/api/Runtime_API/resource
Regards

Jonas

ipravir
Active Contributor
0 Kudos

Hi jonas.brand

Thanks for the information.

I have tried to run the api call though tryout option with all required inputs. However getting "unauthorised" in response.

Attaching screen with details maintaining in header.

Please suggest.

Best Regards,

Praveer

JonasB
Contributor

Hi Praveen,

you need to pass an OAuth token in the Authorization header that you upfront fetch with the credentials from „Tokens“ tab of your bot. Therefore you might not be able to do this easily via „Try Out“ but you need a tool like Postman which supports OAuth.

This tutorial describes the details on this: https://blogs.sap.com/2021/06/13/you-now-must-call-chatbot-apis-with-oauth-heres-how/

Regards

Jonas

Answers (0)