cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sepehr_malek
Community Participant

Different results in Postman vs Curl

Jump to solution

Hello,

I'm trying to get a grip with canvas API's and potentially develop an app which automates a few things for us.

When I run a request via postman I get the correct results back. however, when I run the same request via curl, I get the following error:

{"errors":[{"message":"The specified resource does not exist."}],"error_report_id":149714924}

Can anyone help with this please?

Thanks,

Sep

1 Solution

Accepted Solutions
ColinMurtaugh
Community Champion

Hi Sep --

Postman can generate a cURL command for you, and you can either just use that or compare it to the command that's not working and figure out what's different.  In Postman, there's a "Code" link on the right-hand side of the detail pane; if you click that, you can choose cURL from the drop-down menu in the popup that appears.  Postman may add some extra headers that aren't strictly necessary (Cache-Control and Postman-Token, for example), but you should be able to get an idea of how to correctly format a working cURL command.

Good luck!

--Colin

View solution in original post

4 Replies
kona
Community Coach
Community Coach

 @sepehr_malek , greetings! Due to the technical nature of this question I'm going to share it with the https://community.canvaslms.com/groups/canvas-developers?sr=search&searchId=bd51f773-14a0-4b3a-aa28-...‌ group in the Community to see if they can assist. They are the ones who work more on that side of things - programming - and it might also be useful for you to join the group so you have access to their resources and information.

nnasir
Community Participant

What does your cURL request look like? Are you getting or posting? 

Postman does all the small stuff for you and can run as-is, but if you're doing cURL with a custom script, you may have to do a bit more work (e.g. make sure the correct cURL options are set). 

ColinMurtaugh
Community Champion

Hi Sep --

Postman can generate a cURL command for you, and you can either just use that or compare it to the command that's not working and figure out what's different.  In Postman, there's a "Code" link on the right-hand side of the detail pane; if you click that, you can choose cURL from the drop-down menu in the popup that appears.  Postman may add some extra headers that aren't strictly necessary (Cache-Control and Postman-Token, for example), but you should be able to get an idea of how to correctly format a working cURL command.

Good luck!

--Colin

View solution in original post

Thanks Colin,

This worked perfectly.

Best,

Sep