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

"message": "Invalid request", "source": "api.connectorp.svc.ms"

I'm trying to write an attachment from an email to OneDrive and it keeps erroring with 

{
  "status"400,
  "message""Invalid request",
  "source""api.connectorp.svc.ms"
}
 
However the "fix" was to "not create a folder" 
And I'm not trying to create a folder, I'm just trying to create a file in OneDrive - the folder already exists.
Anyone have a fix for this?
 
Picture of the flow (super simple)
ericsnell_0-1651515646800.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
ericsnell
Regular Visitor

I found the problem - it was not related to the content or the content-type; the resolution was to use the 'picker' to select the file location instead of the 'shared link' to the folder location; this removed the protocol and some of the root path information and put it directly into onedrive -- I've only tested it once, so don't know if it'll keep running, but the file path value appears to have been the issue.

View solution in original post

8 REPLIES 8
Pstork1
Dual Super User
Dual Super User

Can you show what you are using when you create the file in OneDrive?  The JSON for the file content should include $Content and $Content-Type.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

ericsnell
Regular Visitor

  "$content-type""application/octet-stream",
  "$content""JVBERi0xLjQKJd/++LIKMSAwIG9iago8PC......

The $content-type value isn't always application/octet-stream.  There are specific content-types for different types of files.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

These are currently all PDF files I’m trying to save from email so I can then take the next automated step- so I presume in this case the content type will be the same.  Does the content type have anything to do with the error? 

Or does the fact that I’m using my account to do this and there is MFA on it cause this? 

The error you are getting is because the $content-type isn't in the file contents you are using to create the file.  The file Contents field when creating a file should have both a $content-type value and a $content value.  In your flow you only have a $content value.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

not sure I'm following because the result has both a content type and content : 

"$content-type""application/octet-stream",
  "$content""JVBERi0xLjQKJd/++LIKMSAwIG9iago8PC......
 
what am I not seeing?
 
ericsnell
Regular Visitor

I found the problem - it was not related to the content or the content-type; the resolution was to use the 'picker' to select the file location instead of the 'shared link' to the folder location; this removed the protocol and some of the root path information and put it directly into onedrive -- I've only tested it once, so don't know if it'll keep running, but the file path value appears to have been the issue.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (1,875)