Moving from Get response to post

Hi,

I’m still relatively new to snaplogic but i’m really enjoying the learning process on it as I work through my assigned task. I’ve been able to build out a pipeline that:

  • Starts with a csv file on a shared server
  • maps the required values to a REST GET
  • Takes the returned values from the GET and maps those

What i need to do afterwards is where things go off. I’ve done pipelines that post to an endpoint succesfully but what i want to do is take the values from the returned data in the GET snap, along with some values passed along the way on the previous mapper snap and combine those into a new JSON body that will post in the right schema.

I’ve googled and searched on how to actually add a schema so that it’ll show up properly in the post body but i can’t find anything that lines up with my need. Maybe i’m thinking of it in the wrong way.

ANY suggestions on design choices would be appreciated.

Thanks,
Mark

What I’ve done is to add the json schema for the rest post in a JSON formatter snap, mapped my input directly to that schema, and then removed the formatter snap in place of the rest post snap.
Here is where you can add the schema:

Hi @masantiago- How you need those value to pass? Is that from Header attribute or from Query Param?
Seems you need create message payload and pass to API endpoint, such scenario use Rest Post snap, you should get response from endpoint.

Thanks for the reply @acesario . Yeah, i was trying to play around with the formatter snap, I was having a bit of a hard timing understanding how i’d map directly to it. Also, i seemed to then be forced to use a snap that had a triangular input rather than the REST POST which used the circular. But what i eventually ended up doing was actually adding in the nested format in the mapper without the formatter added to it and the output body looked exactly how I needed it to.

i’ll need to try it with a larger file filled with more records but as of now it looks like this’ll work.

Lots of learning going on.

1 Like

Hi @Supratim ,

i needed the values to post as nested objects in a json body as part of a specific schema. so far it looks like i’ve been able to format it how i want using the mapper snap.