web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

API call in repeat loop : The request message was already sent. Cannot send the same request message multiple times.

(0) ShareShare
ReportReport
Posted on by 60

Hello,

I'm trying to call rest API with AL inside a repeat loop, I get this error.

Is there a workaround to avoid it? 

Thanks in advance,

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    Maybe a batch call is another option. Build up the json in the loop and then post a batch. Here is info on the batch method: www.kauffmann.nl/.../

    The above blog is split into 3 parts so you get the full detail

  • Junior_Consultant992 Profile Picture
    60 on at

    Hi Josh,

    The json to consume does not support json array to send a batch of data :(

  • Fayssal M. Profile Picture
    10 on at

    Hi, did you manage it? We have the same issue, the api take as a parameter only an id and we need to loop through all the ids then call the api with each id. Cannot call the api with a json and post a batch, if you have by any chance a solution?

  • Suggested answer
    Fayssal M. Profile Picture
    10 on at

    We actually found the solution.

    We just need to clear all the variables (uri, http request, content, headers...) in the beginning of the loop, now it works perfectly ;)

    Hope that it will help someone ;)

  • andreas@protektit.no Profile Picture
    40 on at

    Hello Fayssal M. Could you show by example how you achieved this? I'm currently stuck at the same issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,092

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans