cancel
Showing results for 
Search instead for 
Did you mean: 

Coupa API GET

manohar
Contributor

hi there,

I need to call Coupa API to do a GET but their API only lets me get 50 records at a time, but they have over 7000 records that I need to pull.

image

how can I increament my url

https://instance.coupahost.com/api/invoices?offset=50&exported=false https://instance.coupahost.com/api/invoices?offset=100&exported=false https://instance.coupahost.com/api/invoices?offset=150&exported=false
.
.
.

I see there are options for these but dont know how to leverage them. any guidance?

image

Thanks
Manohar

1 ACCEPTED SOLUTION

image

hasNext: eval(sl.ensureArray($.get(‘entity’,)).length > 0)
nextUrl: lib.conf.getAppConf(‘coupa’).basepath.concat(“supplier_information?offset=”,(snap.out.totalCount + 1) * 50, “&exported=false”)

View solution in original post

9 REPLIES 9

Good to know, glad to be of help 😀

rpc1235x
New Contributor II

Hello @alchemiz @manohar ,

I am having the same challenge as the original poster. However, when adding Has Next and Next URL. I get this error. Is there an additional step that I need to do like import an expression library? I am also using 

https://instance.coupahost.com/api/invoices?offset=50&exported=false

 

rpc1235x_0-1696270415253.png

 

hasNext: eval(sl.ensureArray($.get('entity',)).length > 0)

nextUrl: 'https://instance.coupahost.com/'.concat('supplier_information?offset=', (snap.out.totalCount + 1) * 50, '&exported=false')

Try enclosing the string with a single-quote or double-quotes
Since you don't have the expression file, it basically just getting the Coupa API base path

rpc1235x
New Contributor II

thank you. Is there any documentation on this expression file? Tried those hasNext and nextUrl and still failing.

rpc1235x_0-1696488462574.png

 

Hi @rpc1235x ,

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438110/Expression+Libraries


You can create your own expression library according to your needs.

alchemiz_0-1697100263330.png


Attached sample expression file

~EmEm