cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jsteele64289
Regular Visitor

Invoke Web Service - Zendesk

Hello All!

 

I'm working on a project right now that requires me to upload some files to Zendesk via API, and then attach them to a ticket later on. I can create tickets and add comments to them, with no problem, but I'm struggling to get files to upload with the method Zendesk suggests. I am starting to wonder if this action in Power Automate Desktop is not capable of doing what I need it to do, and I'm curious if others have seen the same, or if anyone has suggestions.

 

For reference, the attachment procedure is outlined on this page: https://developer.zendesk.com/documentation/ticketing/using-the-zendesk-api/adding-ticket-attachment...

 

They say there's the option to do it from the command line, but I am not able to get this command to work in either PowerShell or CMD:

 

curl "[URL of Attachment]" \ --data-binary @img_0603.png \ -H "Content-Type: application/binary" \ -v -u jdoe@example.com/token:xpfRUSj51oGQta26nhRyaLaIBdhf \ -X POST

 

In PowerShell, the --data-binary section doesn't work and outputs the error:

 

"+ --data-binary @?img_0603.png \
+ ~
Missing expression after unary operator '--'.

 

Any help or suggestions would be appreciated, thank you!

 

 

6 REPLIES 6
VJR
Super User
Super User

Hi @jsteele64289 

 

Something appears wrong with the parameters and the syntax.

 

You have pasted the command from the zendesk documentation so it is not clear what is going wrong with the actual command that you are using via PAD.

Are you able to print the command you are submitting via cmd and display it into a message box and see what's wrong?

 

Also I hope you have taken care of other things like the one mentioned on the documentation.

If the file name contains spaces or other characters that might confuse cURL, enclose the name in quotes. If the file name doesn't have a file extension, make sure to include one in the cURL command

jsteele64289
Regular Visitor

Hey there,

 

Thanks for your response. I do believe I took care of the quotes around items with spaces, and I did include the extension. The code I used in PowerShell was the same as what I pasted, so if there is an issue with syntax, please point it out to me. I got rid of the PowerShell and CMD actions, as they continually gave the error I pointed out in my original post, no matter what I did.

 

I will paste the code I used in Invoke Web Service below:

 

Invoke Web Service:

 

jsteele64289_0-1646834557739.pngjsteele64289_1-1646834570681.png

 

 

 

 

 

 

jsteele64289
Regular Visitor

Also, for what it's worth, the above is the latest in a long series of revisions, and is not indicative of what I would normally try in that action.

 

I have attempted to use the cURL command in its entirety, in the Invoke Web Service action. I have attempted to enclose the filepath in <> "<>" " ", and I've attempted to remove extra white space within the cURL command, all to no avail so far. 

 

Finally, I think it is worth pointing out that in all cases, a file gets uploaded to Zendesk, but the contents of said file are always a copy of whatever text I have submitted in the body of the API request. For instance, Zendesk believes a PDF has been uploaded, but when opening the PDF in notepad, the text is simply the body of the request, and the file will not open in a PDF viewer.

Okay, its hard to tell. Hope you have tried at first in Postman and it works there. Then the same values/parameters can be passed via PAD. Also this will tell whether its an issue in calling the web service or in PAD or in the parameters.

jsteele64289
Regular Visitor

Hey there,

 

Yes, I tried and succeeded in Postman, but also found that PAD was not capable of sending the upload request in the Invoke Web Service action in the same way as Postman can.

 

This is now being achieved with calling a Python script from PowerShell, outputting the tokens from the uploads, and finally feeding those into the PAD action that creates the ticket and adds a comment with the attachment.

 

Let me know if knowing the code itself would be helpful at all, and I can try to post it here!

Glad to know you got to work it out in another way.

Yes you can post it here so that anyone landing on this thread having the same issue can utilise your solution.

 

Also if you think something needs to be fixed or is a new idea in "Invoke Web Service" then you can post your situation for the betterment of the tool.

Power Automate Ideas 

Found a Bug 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,889)