GET Materials/v1

Discussion in 'Shapeways API' started by Rafferty, Jun 25, 2013.

  1. Rafferty
    Rafferty Member
    Hi,

    If I try and call

    https://api.shapeways.com/materials/v1

    I get a page of documentation back for the API (which is fine).

    How do I actually get some values back?

    Do I need to pass my OAuth credentials as URL parameters. If so, what format should the URL take (I've already tried, and got 401 errors).

    Thanks in advance
     
  2. hans_lambermont
    hans_lambermont Shapeways Employee Dev Team
  3. Sending oauth credentials as URL parameters will cause 401 errors. They need to be sent in the authorization header.
     
  4. Rafferty
    Rafferty Member
    Thanks for your response.

    I also get "(401) Unauthorised" when I send the oAuth in the header (that's why I was trying the URL instead). My HTTP request looks something like:


    GET https://api.shapeways.com/materials/v1 HTTP/1.1
    Authorization: OAuth oauth_consumer_key="???",oauth_nonce="???",oauth_signature= "???",oauth_signature_method="HMAC-SHA1",oauth_timestamp= "1372769703",oauth_version="1.0"
    Host: api.shapeways.com
    Connection: Keep-Alive


    Thanks in advance

    Rafferty
     
  5. Are you getting a json error message with the 401? We send those so that you'll know why the 401 was sent.
     
  6. Rafferty
    Rafferty Member
    Yeah! Thanks. The clue was in the JSON.