Jump to content
companje

UM3 API digest with cURL

Recommended Posts

Posted (edited) · UM3 API digest with cURL

The documentation on the Ultimaker 3 (http://UM3/docs/api) contains good examples of how to do PUT and POST requests and I also found a good Python example by Daid) that handles the Digest authentication the Ultimaker 3 uses.

However, I can't find how to do the 'Digest' authentication from cURL. This is not in the examples in the documentation.

I tried adding "--digest --user id:key" to the command but it gives a "message": "400: Bad Request".

$ curl --digest --user 1269546bd8958aa0524c06bc9b18cd6c:9694590217578cf334fbe5d594bc243456d46257f7f10233cb4cf2e3548b5102 -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --data '{ \
  "hue": 0, \
  "saturation": 255, \
  "value": 255 \
}' 'http://10.0.0.39/api/v1/printer/led'

{
 "message": "400: Bad Request"
}

When I just add "--user id:key" (without --digest) it gives {"message": "Authorization required."}. Probably because it tries Basic Auth instead of Digest?

What would be the correct cURL command for the Digest Authentication?

Edited by Guest

Share this post


Link to post
Share on other sites
Posted · UM3 API digest with cURL

If you are looking for the correct cURL syntax, you could use Postman, activate the digest auth and then look at the generated cURL code:

postman1.thumb.png.c57b259aa0b86565ee2acfc7ebc9fd28.png

postman2.thumb.png.ca58fe9f28f261a960cf33cef40130b6.png

  • Like 1

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!