Jump to content

Cross-Domain error when using the API with Ajax

Recommended Posts

Posted (edited) · Cross-Domain error when using the API with Ajax


I'm currently trying to use the API to control remotely my Ultimaker 3 with a webpage.

So, I use Ajax to make a request on the printer but it won't allow me to make the request.

For the moment I try to check the validity of the id :

function checkTicket(ticketId) {
                    type: 'GET',
                    url: '' + ticketId,
                    contentType: 'application/json',
                    headers: {
                        'Accept': 'application/json'
            ).done(function (data, textStatus, jqXHR) {
                switch (data.message) {
                    case "authorized":
            }).fail(function (jqXHR, textStatus, errorThrown) {

But I got an error :


Failed to load Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access.


My request headers :

Accept-Encoding:gzip, deflate
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36


Thanks for your help !

Edited by PeakyBlinders

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Our picks

    • January 22nd  | Ultimaker webinar 'Learn how to choose the right composite material'
      We’ll teach you how to choose the right composite material for your application in our new 40-minute webinar. You will learn how to: 
      • Make the perfect choice between glass and carbon fiber 
      • Identify more high-value applications that would benefit from composites 
      • 3D print advanced materials with the right settings 
      • Select the best materials for 3D printing end-use parts 
      • Use dual extrusion to take composite 3D printing to the next level 
      • 0 replies
    • Does your company use Ultimaker? Know one that does? Let us know!
      If your company uses Ultimaker in any capacity, we'd love to hear about it! If the story is there, and you're up for it, maybe we can work together to create a story that will be featured on the site. Here are examples of..
      • 18 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!