Hello , it has been a great journey to work with Backendless .I am recently stuck in a problem though . I wanted to write Custom Events in Server Side . I got with simple Parameter passing on Events and returing values .
But , I would like to access DATA API , USER API through the Custom Serer Code . I didn’t find any of the API there for custom server code ( neither Java nor php )
My first thoughts are using CURL requests using REST API for getting the data , but are there any specific way of doing it .
if there’s so please suggest me as this is the most important part of my Project and getting me really stuck in .
Regards ,
Pujan Paudel
Hello!
You can use any APIs directly in your custom services. For example, the following sample has method that retrieves first user from the app:
public class MyService implements IBackendlessService
{
public BackendlessUser getFirstUser()
{
return Backendless.Data.of(BackendlessUser.class).findFirst();
}
}
Alex
Okay , I got it . But , how can we call the Service from the Client Side . Like there are API’s to Call Custom Events from the Client Side . Are there any API to call those custom Service from the Client Side ?
Backendless generates client side SDK for your services. The code to call a service is in the SDK:
https://backendless.com/documentation/business-logic/js/apieng_client_sdk_generator.htm