Jump to content
zaaf77

"PUT" cURL command not working

Recommended Posts

Posted · "PUT" cURL command not working

On Swagger I am able to change the name of the printer with the following command

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' -d '"zaaf77"' 'http://192.168.1.38/api/v1/system/name'

But When I run the same command into the command prompt (by changing the single quotes into double) it gives the following error

{"message": "Authorization required."}

How do I authorize it?

I am struggling with the logic as well as syntax mainly! I know the id and key you can get from the following command:

curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'application=laravel&user=mughalz1' 'http://192.168.1.38/api/v1/auth/request'

How do I use this id and key? Or would the id and key be the "root" and "ultimaker"?  again if it is "root" and "ultimaker", how do i use it in the cURL command, Can anyone help with the syntax please?

Actually, i am trying to develop my own interface so that someone can print a model from my website directly. Any thoughts please... ..?

 

 

 

Share this post


Link to post
Share on other sites
Posted · "PUT" cURL command not working
22 minutes ago, zaaf77 said:

How do I use this id and key?

 

What about adding the acquired digest authorization to you first command?

Something like this should work with 'curl':

 

curl -X [...] --digest --user YOUR_ID:YOUR_KEY [...]

 

Share this post


Link to post
Share on other sites
Posted · "PUT" cURL command not working
1 hour ago, tinkergnome said:

 

What about adding the acquired digest authorization to you first command?

Something like this should work with 'curl':

 


curl -X [...] --digest --user YOUR_ID:YOUR_KEY [...]

curl -X PUT --header "Content-Type: application/json" --header "Accept: application/json" --digest --user "4f788954582aa8b80c591bae53a6a0a4":"96c4f972838de37f2f4f14a4bbfc4a9f77ed265ffbb1b80796c3cdd41daa5b39" -d "{\"message":"How are you?",\"button_caption":"Okay"\}" "http://192.168.1.38/api/v1/system/display_message"

😴

Now it's giving the error saying {"message": "400 Bad Request"}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Our picks

    • Ultimaker Cura 4.0 | Stable available!
      Ultimaker Cura 4.0 is mainly focused on the improved user interface and cloud integration.
      As always, we want to collect your user feedback for this release. If there are any improvements you can think of, feel free to mention it here and help us to shape the next release.
      • 98 replies
×
×
  • Create New...

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!