A few questions regarding the API

Discussion in 'Shapeways API' started by sjorro, Apr 15, 2011.

  1. sjorro
    sjorro New Member
    Hi all,

    I have a few questions regarding the shapeways API.
    I already asked Shapeways Eindhoven (it's in coop-mode with them), they told me to also post it on the forum.

    For those of you who don't know what I am creating:
    I'm creating an application wich will be available on shapeways in the near future. It leveradges a certain formula to let users create their own models; models that are allways printable.


    So here it goes:

    Login:
    Currently I am logging in as the applications' (*my own) account. I also send an application id (*'supershapes')
    When I upload the model I have to use the session_id returned from this login.

    Should I login as the application or should I make the user login?


    Materials:
    As I mentioned before in a previous post, but for complete overview:
    When I get the materials from the api, the color comes in like: <base_color xsi:nil="true"/>

    Can this be fixed so that I can show the right colors on the model?


    Price:
    When calling the getprice method, I should send to shapeways the volume of the model. Shapeways has already a method implemented in the site to do this.
    Is it possible to get a code-snippet so that the price shown in my application on shapeways is almost exactly the same as shown on shapeways later on?

    I want to show the price beforehand, because when the user is going to the order page, the flash is closed and the user can't go back to his/her model.


    Upload with MaterialID:
    When uploading a model I can't send in a material_ID.
    Can this be added?

    After uploading a model I want a user to order his model with a certain material, from which he/she already agreed on the size and pricing, which requires me to send in a material chosen for the model


    Upload Model Check:
    After model upload shapeways performs certain checks on the model to ensure model integrity.
    This check takes a few minutes for my high-res models, which I would like to omit for the end-users' sake.
    Can this check be avoided in some way? (for example using my application id?)

    I already build these models programmaticly, so they are allways printable, and before going live the program will be tested accordingly.


    Order:
    When a user has completed the flashprogram and uploaded it's model with a certain size and material, he/she would like to order it.

    In the current situation the model is uploaded into his/her store.

    Can the model be uploaded to the supershapes store, and the user be redirected directly to the order-page of the model, by using for example the session-id (or the model-upload_id, gotten from the upload)?


    I hope to get some clarity through this... :)

    Kind Regards,

    Sjoerd van den Berg.
     
  2. robert
    robert New Member
    That depends on what you want. Both are possible. If you want to set a markup on the model you should upload and login using your shop account.
    Yes we will fix this.
    I am not sure what you mean. How is the price different via the API versus what you see on the website?
    That is correct. The user can select the material on shapeways.com. It does sound useful to me to be able to set the material restrictions through the API.
    We can consider this. I can even imagine that we allow the model to go through directly from trusted / certified applications and do the validation in the background (just to be sure).
    If you use your shop username / password you can directly upload the model to your own store.

    There is a hidden feature. If you use application-id = "generated-creator" the submitModel method will return the model_id upon success instead of TRUE.

    Best,

    Robert
     
  3. sjorro
    sjorro New Member
    Hi Robert,

    Thank you for your reply!

    The thing I mean with the price is the following:

    Quote (me):
    Price:
    When calling the getprice method, I should send to shapeways the volume of the model. Shapeways has already a method implemented in the site to do this.
    Is it possible to get a code-snippet so that the price shown in my application on shapeways is almost exactly the same as shown on shapeways later on?

    I want to show the price beforehand, because when the user is going to the order page, the flash is closed and the user can't go back to his/her model.

    Quote (Robert):
    I am not sure what you mean. How is the price different via the API versus what you see on the website?


    What I mean is:
    After uploading a model in any kind of way, shapeways shows a price calculation based on the volume of this model.

    Shapeways already has some kind of code to calculate this volume.

    Could I get this piece of code, to make sure my calculation of the volume is exactly the same as the calculation of volume shapeways does.

    This means I would get the exact same volume of the model shapeways does, result: same price display.


    Kind regards,


    Sjoerd van den Berg.
     
  4. robert
    robert New Member
    Ah but you can use the upload API to get the price.

    The method getModelPrice() allows you to get the price of a model.

    The reason is that we would like to be able to change price model at a moment's notice and if you would build it into your application the price calculations can go out of sync.

    Best,

    Robert
     
  5. mctrivia
    mctrivia New Member
    What we need is the formula to compute the volume. That way we can have the same price on our side as on your side.

    For example I sell most of my products for $9.99. I compute the volume calculate the cost then subtract this from what I want to sell it for to give you the markup. If my volume is off though I may show for $10 or $9.98. or worse. I do not set say $2 markup per model.
     
  6. sjorro
    sjorro New Member
    That's right, what I meant is exactly what Matthew says.
    We need the formula to calculate the volume, to ensure price display is correct.

    Regards,

    Sjoerd van den Berg.
     
  7. mctrivia
    mctrivia New Member
    I have added this as feature request 9. Hopefully we will start seeing some of the requests done soon.
     
  8. robert
    robert New Member
    We are in the process of making available a reference application for the volume calculation. It will be available as open source.

    It probably takes another week to get it out there together with some other goodies.

    Just hold tight!

    Robert
     
  9. sjorro
    sjorro New Member
    Thanks Robert, you're the best! :D

    :)
     
  10. abite
    abite New Member
    Hi. Any updates on the reference application of the volume calculation? I'm still trying to solve the issue.

    I solved it using cURL. cheers~
     
    Last edited: Mar 28, 2012
  11. wangzhaoguang
    wangzhaoguang New Member

    Hello abrit

    Would you please share with me your solution, because now i am working on my own website:
    (1) i want to use shapeways API to get the model olume;
    (2) i, also, want to define my own price factor to display a price for the customer.

    Best regards

    zhaoguang WANG
     
  12. bartv
    bartv New Member
    Hey Wangzhaoguang,

    this discussion is quite old and is referencing our previous API. Please take a look here for the full documentation of the latest version:

    https://developers.shapeways.com/

    Cheers,

    Bart