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

alchemiz
Contributor III

Hi @manohar ,

Good day, before what I did wasโ€ฆ

Set the has next property where you check the returned entity of coupa api

eval(sl.ensureArray($.get(โ€˜entityโ€™,)))

then for the next page

โ€˜โ€™.concat(โ€˜https://instance.coupahost.com/api/invoices?offset=โ€™, (snap.out.totalCount + 1) * 50, โ€˜&exported=falseโ€™)

then set pagination interval maybe 1 or 2 secs

Hope this helps

Thanks,
MM

Hi @alchemiz , thank you for your help.

I have tried but still gets me only 50 records. I am sure, I am not doing right. Please check the pipeline that I tried to build. Can you please tell me whats missing?

CoupaExtract_2023_01_24.slp (23.6 KB)

Thank you,
Manohar

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โ€)

thank you very much. that did it.