Showing results for 
Search instead for 
Did you mean: 

How to call an API in SAP CDC Javascript

0 Kudos


We have a requirement to make an account.resetpassword API on reset password UI builder page. So can some one help how to make an API call in Javascript it would be helpful if get a sample code.


Active Participant
0 Kudos

Hi Maheswari K,
Could you add more clarity? It could better understand your requirement.

You need to call accounts.resetPassword JS API here(screenshot attached)?
And what exactly you need to do base on your requirement?

0 Kudos

Yes, I have password reset error page where it will show an error if password reset token expires. so now I need to modify that page like previous link expired and new password reset link will send in that case I need to trigger password reset API on the error page. so the process is when ever user gets error page automatically new reset password email should trigger

Accepted Solutions (0)

Answers (1)

Answers (1)

Product and Topic Expert
Product and Topic Expert


You can make an API call using the JavaScript Fetch API. Here is an example of how to call a resetpassword API using the Fetch API:

// Make a POST request to the resetpassword API
fetch('', {
method: 'POST',
body: JSON.stringify({
username: 'exampleUsername'
headers: {
'Content-type': 'application/json; charset=UTF-8'
.then(response => response.json())
.then(json => {
// This is where you can handle the response from the API
0 Kudos

I tried this one and its not working

Product and Topic Expert
Product and Topic Expert

do you have API endpoint ? or sample endpoint ?