Forum Discussion

dchou's avatar
7 years ago

From Endpoint make multiple post call

I am trying to send custom mail using web API in endpoints.

 

When I do multiple post request of mail API in loop only one request is sent which is last one.

 

Please give me some solution to perform multiple post request using endpoint.

 

 

 

3 Replies

  • dchou's avatar
    dchou
    Ace
    7 years ago

    VikasBHere is the code

     

    <#list somebulkelement as element>
             <#assign request= http.client.request(Some post call)/>
    </#list>
                
  • VikasB's avatar
    VikasB
    Boss
    7 years ago

    dchou

    A few days back, we were on the same page. But we were able to hit the multiple calls in the loop. Below snippet can be helpful for you otherwise I would suggest raising a ticket to support as it may be an instance-specific issue. 

    <#assign getCities = http.client.request("https", "api.meetup.com", "/2/cities?country=${selectedLocale}").json().get().content />
    <#assign eventsArray = [] />
    <#assign counter = 0 />
    <#list getCities.results as allCities>
      <#assign url = '/2/open_events?key=${key}&country=${selectedLocale}&city=${allCities.city?url}&text=${searchInput?url}' />
      <#assign http_client_request = http.client.request("https", "api.meetup.com", url).get().content />
        ${http_client_request}
        ${allCities.city}
    </#list>