Forum Discussion

manohar's avatar
manohar
Contributor
5 years ago

Rest Post with attachment and form data

Hello Snaplogic gurus,

Can any one give me pointers how I can convert this into snaplogic pipeline?

Thanks
Manohar

curl -L -X POST ‘https://test.coupahost.com/api/purchase_orders/471/attachments
-H ‘Accept: application/json’
-H 'X-COUPA-API-KEY: xxxxxx
-F ‘attachment[file]=Coupa_Supplier_termsv5.pdf’
-F ‘attachment[type]=file’
-F ‘attachment[intent]=Supplier’

3 Replies

  • lazo_ilijoski's avatar
    lazo_ilijoski
    New Contributor III

    Hi @manohar,

    You can use REST POST snap in which you can set header parameters in HTTP header section:

    If you want to attach a file to POST service, you have to upload the file in SLDB at first and then you can specify the file in Single file upload: File, as well as the name you want to be used, for instance:

    Don’t forget to remove the file (by using File Delete snap) after you call the rest service.

    BR,
    Lazo

    • manohar's avatar
      manohar
      Contributor

      Thanks Lazzo,

      How or where can I add this form data?

  • Hi @manohar,

    You use the “HTTP entity” of the snap for the form data (shown in the last print-screen).