Search the Community

Showing results for tags 'android api'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Rebrickable
    • News
    • Suggestions
    • Help!
    • Bugs
    • API
    • Mobile App - Rebrickable LEGO Shopper
  • Inventories and Data
    • Set Inventories
    • MOC Discussions
    • Other Data
  • Other Stuff
    • LEGO News, Events, Community
    • Non LEGO
  • Projects

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Bricksafe URL


Location


Interests


Favourite Set(s)

Found 1 result

  1. Starting over in Android I am once again having some issues: I keep on getting a 403 error with this call, here is the code I am using from Android Studio: url = new URL("https://rebrickable.com/api/v3/users/_token/"); conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.setDoOutput(true); conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); conn.setRequestProperty("Accept", "application/json"); conn.setRequestProperty("Authorization", "key {myKey}"); conn.setRequestMethod("POST"); // Send the post body if (prop.PostData != null) { String postData = prop.PostData.toString(); //example postData: //"{password=******, username=********}" OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream()); writer.write(postData); writer.flush(); } int statusCode = conn.getResponseCode(); if (statusCode == 200) { InputStream inputStream = new BufferedInputStream(conn.getInputStream()); response = convertStreamToString(inputStream); } Any ideas?