Skip to content

Quick Start Guide

This Quick Start guide will walk you through the process of creating a Backendless API service by editing the service code online using Backendless Console. By the time you finish the guide, you will have a working API service hosted in Backendless. You will be able to experience REST-based method invocations and download generated client SDKs.

  1. Create a Backendless account if you do not have one. You can register for your free account at https://develop.backendless.com/registration
  2. Login to Backendless Console and select your app.
  3. Click the Business Logic icon to enter the server-side code management area.
  4. Click the CODING menu item and select JS from the language dropdown list as shown below:
    js-coding-biz-logic.zoom50
  5. Right click the services node in the tree and select New file.
    new-file-in-services
  6. Enter a name for the JS file which will contain the service code. For example, MyService.js and click CREATE:
    js-service-file-name
  7. Backendless creates the file and opens it for editing. Paste the following code into the file editor:

    class MyService {
      /**
       * @param {String} name
       */ 
      helloWorld( name ) {
       return "hello " + name;
     }
    }
    
    Backendless.ServerCode.addService( MyService );
    

  8. The code above is a JavaScript class (MyService) with a method (helloWorld). Notice the @param annotation in the JS code comment. The annotation describes to Backendless the type(s) for the method argument(s). Click the Save and Deploy icon/button to deploy the code to Backendless.
    save-and-deploy

  9. Once the code is deployed, Backendless Console will inform you with a notification popup in the upper right corner:
    notification-popup
  10. Click API SERVICES to switch to the service browser screen. The MyService service will appear in the list with the first method selected. Enter a value for the name parameter and click INVOKE. The service method is invoked and console displays the result in the RESPONSE panel:
    invoke-hello-world
  11. Click CODE to see a cURL command to invoke the method with the entered values of the parameter. You can copy the entire text of the command and paste in a terminal window to run it outside of the browser:
    curl-service
  12. Additionally, Backendless generates various client SDKs for the API service. You can learn how to use the generated SDKs in the Client SDKs section.
    download-native-sdk