Podio REST api

  • 1
  • Problem
  • Updated 7 months ago
  • In Progress
I have connected Podio api to skuid. But the Body parameter with every request is not working. I filter items from an App and for that i have to give some json parameter to the endpoint. I checked the same in Postman it worked. But not working in Skuid. why?
Photo of logita

logita

  • 140 Points 100 badge 2x thumb

Posted 7 months ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
A few thoughts. 
1. Inspect your network traffic to see the specific request and body that Skuid is sending to Podio. This will let you see the difference between what Skuid is sending and Postman. 

2. Can you post a picture of your setup - showing where the body parameter is configured? 

3. Are you trying to merge data into the body parameters?  That is not currently supported in our declarative builder. You have to do that in Javascript.  Its a known issue and will be changed.  But... 

Hopefully these items help. 
Photo of logita

logita

  • 140 Points 100 badge 2x thumb
Ok, Actually i have to pass limit and offset to get data from datasouce. The limit and offset have to pass as body parameter as {"limit" : 500, "offset" : 0}, this will return 500 data. As by default it is returning only 20 data. I am passing body data as
I was sending data like this.
But it is not working. How to send it through javascript?



(function(skuid) {    var $ = skuid.$;
    $(document.body).one('pageload', function() {
        var myModel = skuid.model.getModel('leads');
        var myComponent = skuid.component.getById('sk-2-Bt-265');
    });

    try {

        var request = '{ ' +
            '{ "limit" : 500}, ' +
            '{ "offset" : 0} ' +
            '}';
        console.log(request);

        $.ajax('/item/app/20031858/filter', {
            data: request,
            type: 'POST',
            crossDomain: true,
            dataType: "json",
            beforeSend: function(xhr) {
                
                xhr.setRequestHeader('Content-Type', 'application/json');
            },
            success: function(response) {
                console.log([response[0].outputValues.output, response[1].outputValues.output]); // ['returnValue1', 'returnValue2']
            },
            error: function(jqXHR, textStatus, errorThrown) {
                console.log([jqXHR, textStatus, errorThrown]);
            }
        });
    } catch (e) {
        console.log(e);
        alert(e);
    }

})(skuid);

This is the javascript code currently i am sending but not working.
(Edited)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Again the best thing here is to inspect the network traffic that is being generated by Postman and what is generated by Skuid.  This will show you what is working in Postman, and how it is different than what is happening in Skuid. 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Also make sure the parametres are not being passed as extensions of the enpoint (URL parameters) rather than in the body.  You may be able to define those things just in the base URL for an individual model instead of having to create a separate body payload in the data source. 
Photo of logita

logita

  • 140 Points 100 badge 2x thumb
But they are body parameters not url parameters.
Photo of logita

logita

  • 140 Points 100 badge 2x thumb
How to send json body Parameter in SKUID?
Photo of logita

logita

  • 140 Points 100 badge 2x thumb
This reply was created from a merged topic originally titled Podio REST api post data.

Hello,
I have connect Podio api with skuid and making a post request. The post request requires body parameters to be send as {"limit":500,"offset":0}.I am trying to send body parameter under data source as Common Request Body Data

But this is not working.Where am making mistake.and how to pass json data in body parameter? or any other way to do this.