| Model URL after upload [message #36054] Thu, 06 October 2011 15:59 UTC |
 |
|
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
|
|
|
| Re: Model URL after upload [message #36068 is a reply to message #36054 ] Thu, 06 October 2011 18:38 UTC |
  |
|
there is but it is not documented. let me see if I can find it.
Follow me on twitter http://twitter.com/mctrivia or my blog at http://4ddice.blogspot.com/
|
|
|
|
| Re: Model URL after upload [message #36112 is a reply to message #36054 ] Fri, 07 October 2011 08:00 UTC |
  |
|
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:
$result = $this->client->submitModel($this->session, $model, null, 'generated-creator');
And you use the function like this...
$result = $connection->uploadFile($fileName);
if(is_numeric($result)){
$nr = intval($result);
$link = 'http://www.shapeways.com/model/'.$nr.'/'.$fileName.'.html';
}
|
|
|
| Re: Model URL after upload [message #36127 is a reply to message #36112 ] Fri, 07 October 2011 11:11 UTC |
 |
|
The filename on safeways is fake. You just need up to the / after model number.
Follow me on twitter http://twitter.com/mctrivia or my blog at http://4ddice.blogspot.com/
|
|
|