Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Upload File by consuming REST web service

(0) ShareShare
ReportReport
Posted on by 944

Hi Everyone,

Can anyone share good example for upload file / send file by consuming external REST Web service ? 

My end point would be something like bellow

 myapi.com/.../upload

I have to pass three parameters, API Key, Workflowid and file. 

I wrote bellow code,

userFile := 'D:\Temp\Helvetia.pdf';

RequestURL := 'myapi.com/.../upload';

Req := '{"api_key":"5445989G98398fs3t5","workflow_id":"939925","userfile":"'+userFile+'"}';
Request.open(HTTP_POST_REQUEST,RequestURL,FALSE,'','');
Request.setRequestHeader('Content-Type','multipart/form-data');
Request.send(Req );
IF Request.status = 200 THEN
 MESSAGE(Request.responseText);

But I am getting error. But I try using SOAPUI, it worked. 

Can anyone help suggest good method to pass file by consuming external REST API


Thanks

*This post is locked for comments

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics NAV (Archived)

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2

#1
mmv Profile Picture

mmv 2

#1
Amol Salvi Profile Picture

Amol Salvi 2

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans