cancel
Showing results for 
Search instead for 
Did you mean: 

How to define ajax call in SAP MDK

KrishnaReddy
Discoverer
0 Kudos

Hello experts,

We have a requirement where we need to call ajax get and post calls.

We are trying the below code( SAP UI5 code)in a rule but its was not working

Here URL is we are using Mobile service Registration URL under API section.

 

export default function PostEmailIdDetails () {
$.ajax({
method: "POST",
success: onRegSuccess,
error: onRegError
});
}

We need to define ajax call to update the email id in the mobile service user registration.

Please advise how we need to call?.

@bill_froelich 

Thanks,

Krishna.

 

View Entire Topic
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

You will most likely want to use the ClientAPI sendRequest method which will return a promise with the HTTP response.

KrishnaReddy
Discoverer
0 Kudos

Hi Bill, Thanks for the update, could you please help what could be the exact URL path for "Destination" and "Registration" Under mobile services section API example Destination : https://XXXXX.ap10.hana.ondemand.com/<DestinationName>

Registration: https://XXXX.cfapps.ap10.hana.ondemand.com/odata/applications/v4/<ApplicationID>/Connections

we can directly add the URL or we need to add anything suffix.

Thanks,

Krishna.

@bill_froelich 

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

When using sendRequest it will always start with the base URL for the mobile services instance.  So the URL specified would be whatever path is needed after the Server URL.  The API page in Mobile Services will have the full URLs where you can determine the remaining path needed for the call.