Forum Discussion

manohar's avatar
manohar
Contributor
3 years ago
Solved

Coupa API GET

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.

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?

Thanks
Manohar

  • 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”)

9 Replies

  • alchemiz's avatar
    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

    • manohar's avatar
      manohar
      Contributor

      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

      • alchemiz's avatar
        alchemiz
        Contributor III

        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”)