Sugar Mobile endpoint call

Hi, This is my question.

It's for the mobile part.

It's possible to call an endpoint from cordovapost.

Something like this, I can't find any reference or documentation to this.

In this example from sugarmobile in cordova.

app.api.call('GET', app.api.buildURL('CT1_Contratos/5744f939-6b8f-4f89-b12b-903e1dcbecc5/pdfParamas'), null , {

function (data)
{
  console.log(data);
},
funcion (error)
{
  console.log(error);
}


});

The api is called, but I don't know in Android and iOS, the api call adds an extra "_1" to the call. (v11_1) and should be only (v11)

 11405-11510/com.inteliK.crm D/Nomad: undefined https://jgarcialopez.sugarondemand.com/rest/v11_1/CT1_Contratos/1ac66764-beea-11e9-bcf5-0286beac7abe/pdfParamas
08-15 19:29:54.504 11405-11510/com.inteliK.crm D/Nomad: Payload:
08-15 19:29:54.508 11405-11510/com.inteliK.crm D/Nomad: params:

  • Hi Enrique
    In current implementation Sugar Mobile uses configuration property "serverRestVersion" to build final endpoint URL. Basically rest version prefix is based on server version and default configuration looks like this (see our documentation for configuration)

    /**
    * @property {string} serverRestVersion - REST API version by server version.
    * login and metadata requests still use restVersion parameter
    * @private
    */
    "serverRestVersion": {
    "7.9": "10",
    "7.10": "11",
    "8.0": "11_1"
    },

    So if you are connecting to Sugar server 8.0 and above then "11_1" prefix will be used. If you need to change this behavior you can override this config setting in your custom app according to your needs