Exception : Invalid auth/bad request (got a 500, expected HTTP/1.1 20X or a redi rect)

Discussion in 'Shapeways API' started by 341025_deleted, Aug 9, 2013.

  1. Hello,

    I am using the php-pecl method on a windows pc through the command line to upload some models. I've been able to get the access token and all of that, but I run into problems when I run the "ModelUpload-oauth1-pecl.php" file from the examples to upload a model. The model does actually upload but returns an error in the process somewhere in this line:

    $oauth->fetch($api_url_base ."/models/v1", $data_string, OAUTH_HTTP_METHOD_POST, array("Accept" => "application/json"));

    The error reads:

    Exception : Invalid auth/bad request (got a 500, expected HTTP/1.1 20X or a redi rect)

    This wouldn't be too much of an issue, since the model actually uploads, but most of my parameters aren't being implemented. I am trying to adjust the "uploadScale" and the "defaultMaterialId" parameters but they always come out as the defaults. I'm assuming that's because of this error. I can change the "title" parameter though. So it's probably getting the error somewhere between those parameters. Any ideas?

    I also tried the nodejs method and got a very similar error.

    Thanks in advance
     
  2. What indicates that your model uploaded correctly? If there is a 500 error, the model is not actually saved in our system and you are not returned a model id which would identify it. If you are trying to edit a model that has already been uploaded, then you need to use PUT instead of POST.

    If you're still having trouble, please post the entire message. There should be an error in there specifying the exact problem. For example:
    'body_recv' =>
    string(62) "33\r\n{"result":"failure","reason":"Empty file provided"}\r\n0\r\n\r\n"

    Thanks,
    Beekey
     
  3. Hello thanks for responding. So my model is actually uploading and is being listing on my shapeways account, but I am getting an a 500 error saying this :

    A fatal error occured during fetch exception
    Exception : Invalid auth/bad request (got a 500, expected HTTP/1.1 20X or a redirect)

    Again, the model is actually being uploaded but my parameters aren't being applied so i can't change the scale or default material.

    Thanks.
     
  4. Somehow I created another account, another access token and I am no longer getting the error.