Start a new topic

Custom Endpoint request module not working

When I copy the example for getting data from an external API from the kinvey docs: 


 

    var req = modules.request;
    req.get('http://developer.mbta.com/Data/Red.json', function(error, resp, body){
        if (error){
            response.body = {error: error.message};
            response.complete(400);
            return;
        }
        response.body = JSON.parse(body);
        response.complete(resp.status);
    });

If I try and use this and then test the endpoint using the built in tester I get an error of code: "ECONNRESET"


Any help would be appreciated.


thnaks for  this valuabe question...Have you recently receive a new Old Navy Credit Card? If yes, then  is a must-required process. bankslogin.on

Hi Kinvey Team, 


I have created one custom endpoint on kinvey console. But do'nt know how to test on Kinvey console and debug the Business logic.

When i am calling this endpoint by authorization header in nativescript App:


 

Kinvey.CustomEndpoint.execute('progressExample', {

           authorization: Kinvey.User.getActiveUser()._kmd.authtoken,


        })

        .then(function(response) {

            console.log('response-----------------'+JSON.stringify(response) );

        

        })

        .catch(function(error) {

            console.log('error-----progress'JSON.stringify(error));

        });


After running the code, i am getting below error:

 error-----progress"The Business Logic script has a syntax error(s). See debug message for details."


Please guide me.










txt
(737 Bytes)

Hello Cameron,


It seems the URL [http://developer.mbta.com/Data/Red.json] which you are using is not working any more.

I have replaced the URL with working URL, tested the same code using  Custom Endpoint BL built in Tester and its working .


Please let us know if you have more questions on this !


Thanks & Regards,

Akhil DT
Technical Support Engineer
https://support.kinvey.com/

image


Login or Signup to post a comment