Support Topics Documentation Slack YouTube Blog

REST API End Point

(mike turner) #1

Pretty new to the API Services on the Business Logic side on Backendless so forgive any wrong terminology!

Following Marks (excellent) video made good headway beginning an api.

I can successfully run a GET request like this…

and my corresponding simple code in the business logic code area is this.

  • @route GET /myCustomers
  • @param {int} id
    helloCustomer( id ){
    return "hello customer id: " + id;

but what I can’t achieve is getting the ID without using a parameter in the URL. I need this as I have to produce an endpoint more like this (as requested by another 3rd party app)

Is this possible and if so could you show me the code?

Many thanks.


(Vladimir Upirov) #2

Hi Mike
Yes, it’s possible, you can override request method and request route as well
here is a doc for that

and a simple example:

'use strict';

class SampleService {
   * @route GET /my-custom-route/items/{itemId}
   * @returns {Object}
  getItem() {
    const { itemId } = this.request.pathParams
    return { 


(mike turner) #3

Excellent, thanks Vladimir.

That works perfectly, just what I wanted.

(Vladimir Upirov) #4

good, glad to hear it