oauth for 'user' only app - no consumer

Discussion in 'Shapeways API' started by 225132_deleted, Aug 27, 2014.

  1. Hi,

    I'm trying to setup an api connection from our web-platform at suuz.com to shapeways.

    However i'm having trouble with understanding how to use the oauth procedure for this;

    - i don't want to use a pop-up saying "allow this app to your shapeways account" since it's only us that is using it.

    how should my auth. process then be designed? (it's basically not what oauth is designed for i guess..)

    i have the following parameters and url's but don't understand what to call in what kind of procedure to do it automatically...

    consumerkey+secret
    request token
    access token + token secret

    GET /oauth1/request_token/v1
    GET /oauth1/access_token/v1


    i'm using .NET and have the example from the shapeways github, only that doesn't clear much up either.

    anybody any idea?


    thx,
    Elco

     
  2. Update: the whole process works;

    I only wonder if it's somehow possible to cut out the authentication screen from shapeways... since it's us only using it.

    If anybody knows?

    thx,
    Elco
     
  3. brettlangdon
    brettlangdon Member
    Hey Elco,

    Yes, if you authenticate as yourself you will get the OAuth Tokens/Secret/etc for that user. You can then hard code those values into the app for the api requests. The token/secret will not expire. This also means that every action taken on the API will be as that single user. You will only have access to the one users shopping cart, models, pictures, etc.


    Hope this helps,

    Brett
     
  4. cool thx for the tip!

    gonna give it a try ; )


    chrs,
    Elco
     
  5. Hi Brett,

    I currently get really strange results;

    i'm using the /orders/cart/v1 function to upload a model (public) to my cart.
    First i tried non public but that seems to return 500 errors.

    Now i've succesfully (meaning the api returns 'success', added a model (id = 1324048) but the whole shapeways shoppingcart returns Internal Error 500 !!
    (I repeat: Not on my app; but on the live shapeways website for my account :S )


    any idea what has happened?


    chrs,
    Elco
     
  6. brettlangdon
    brettlangdon Member
    Hey Elco,

    Thank you for letting us know about the 500 error on the shopping cart, I am not sure what is going on but I have reported internally. I will try to update you here if I get any more information about the progress.



    Thanks,
    Brett

     
  7. Hi Brett,

    Thanks for the quick reply.

    as an add on; my shopping cart was empty and i posted this model over the api:

    ShapewaysCartItem cartitem = new ShapewaysCartItem
    {
    //gridlock ring
    modelId = 1324048,
    materialid = 78,
    quantity = 1
    };

    If i GET the shoppingcart it still shows this item is in there.
    Only the webpage doesn't work...(see attached screenshot)

    So if you can empty my shopping-cart for my account someway? because all is not working now ;)


    thx,
    Elco

     

    Attached Files:

  8. brettlangdon
    brettlangdon Member
    Hey Elco,

    I have removed the item from your shopping cart. It looks like the issue is that you added the item to your cart and then made the item a cocreator template, which, cocreator templates are not allowed to be purchased directly. The 500 error is still a bug that we need to handle more gracefully and is reported.


    Hope this helps,
    Brett
     
  9. Hi Brett,

    Many thx, that clearifíes the situation. I just randomly inserted a ModelId in my code from my products, one that was public.

    I now see that most of our products are indeed 'activated' as co-creators; mostly with text or ringsize.
    I will not order those directly.

    thx,
    Elco