Model URL after upload

Discussion in 'Shapeways API' started by emnullfuenf, Oct 6, 2011.

  1. emnullfuenf
    emnullfuenf Member
    Hello all,

    is there a way to get the URL of an uploaded model? I think about the product details page that is sent by e-mail when the model is ready.

    There should be an API call that get's a models status when sending a session ID like "getModelPrice" does.

    Am i missing something?

    Em
     
  2. mctrivia
    mctrivia Well-Known Member
    there is but it is not documented. let me see if I can find it.
     
  3. emnullfuenf
    emnullfuenf Member
  4. macouno
    macouno Member
    Yeah here's a bit of my code, because I think more people will be looking for this...

    Of course I make sure the fileName is nicely formatted first. I do that using this function: make-a-safe-url It may be for urls, but works great for making sure filenames are formatted correctly as well.

    So inside the uploadFile function (in SoapAPI.php) you do this:

    Code:
    $result = $this->client->submitModel($this->session, $model, null, 'generated-creator');
    And you use the function like this...

    Code:
    $result =  $connection->uploadFile($fileName);
    		
    if(is_numeric($result)){
    	
    	$nr = intval($result);
    	$link = 'https://www.shapeways.com/model/'.$nr.'/'.$fileName.'.html';
    }
     
  5. mctrivia
    mctrivia Well-Known Member
    The filename on safeways is fake. You just need up to the / after model number.