Skip to content
Commits on Jan 2, 2016
  1. Overhaul the README

    Alan Pierce committed
    Add sections for how to get help with the API (some of which was moved from the
    "Khan Academy API Authentication" page) and how to contribute. Also rewrite
    basically everything else because it had gotten out of date.
    
    Auditors: benkraft
Commits on Oct 13, 2015
  1. @csilvers
Commits on Aug 24, 2015
  1. @alangpierce

    Merge pull request #93 from hblumberg/test_client2_fix

    alangpierce committed
    Ensure test_client2 handles URL queries.
  2. @hblumberg

    Ensure test_client2 handles URL queries.

    hblumberg committed
    Addresses: #92
    
    Test Plan:
    Run test.py, ensure "/api/v1/user?email=[email address of authenticated user]" returns information about the authenticated user.
Commits on Jul 22, 2015
  1. @hblumberg

    Address bug reports in the new API client.

    hblumberg committed
    Summary:
    1. Change response.json() to response.text so there's no crash on timeout.
    2. Remove "format=json" parameter since it fails with csilvers' new arg validation.
    
    Addresses: https://app.asana.com/0/27216215224639/42347977167518/f
    
    Test Plan:
    Ensure test.py completes the authentication process successfully.
    Ensure subsequent API calls are successful.
    
    Reviewers: alan
    
    Reviewed By: alan
    
    Subscribers: csilvers
    
    Differential Revision: https://phabricator.khanacademy.org/D19747
Commits on Jun 11, 2015
  1. @hblumberg

    Add updated samples of KA API clients.

    hblumberg committed
    Summary:
    Add samples for new authentication steps (/api/auth2). The "examples" directory in https://github.com/Khan/khan-api currently has two outdated API clients, which use the old /api/auth API.
    
    Addresses: https://app.asana.com/0/35650367474073/35539396390394
    
    Test Plan:
    Ensure test.py completes the authentication process successfully.
    Ensure subsequent API calls are successful.
    
    Reviewers: alan
    
    Reviewed By: alan
    
    Differential Revision: https://phabricator.khanacademy.org/D18362
Commits on Jun 8, 2015
  1. @hblumberg

    Tell .arcconfig to use the .arclint file in the khan-api repo.

    hblumberg committed
    Summary: Similar to change in webapp: https://phabricator.khanacademy.org/rGWA99268e3a1e7b5eeac6357d9d844457ffc1302226#387e7f10
    
    Test Plan: Ran 'arc lint' before and after this change, had it succeed after.
    
    Reviewers: csilvers
    
    Reviewed By: csilvers
    
    Subscribers: alan, marcos
    
    Differential Revision: https://phabricator.khanacademy.org/D18363
Commits on May 20, 2015
  1. @nsfmc

    Create .arclint

    nsfmc committed
    summary: add `.arclint` file now that lint engines are deprecated in global .arcconfig files.
    
    auditors: alan
Commits on Mar 30, 2015
  1. Fix OAuth signing with repeated parameters in the sample client

    Alan Pierce committed
    I just deployed a fix to the server signing implementation, so the sample client
    needs to be fixed as well.
    
    Test Plan:
    Log in with the test client.
    Run this request:
    /api/v1/user/exercises?username=alangpierce&exercises=addition_1&exercises=multiplication_1&format=pretty
    The request succeeds, and the response contains two elements.
    
    Auditors: benkomalo
Commits on Mar 27, 2015
  1. @alangpierce

    Merge pull request #86 from jb-1980/master

    alangpierce committed
    Allow multiple values per parameter
Commits on Mar 4, 2015
  1. @jb-1980
  2. @jb-1980
Commits on Feb 4, 2015
  1. @alangpierce
  2. Add a sample PHP client

    Alan Pierce committed
    This uses the oauth-php library to go through a browser-based authentication
    flow. I also included the oauth-php library directly as a dependency.
    
    Test Plan:
    Visit localhost:8001/ka_client.php, click the login button, log in, it redirects
    to a page with a form for making a GET request. Run the default request and
    gives back my user data.
    
    Auditors: marcos
Commits on Aug 13, 2014
  1. Make the test client show the response body for HTTP errors

    Alan Pierce committed
    Summary:
    Previously, only the title of an error response (e.g. "Unauthorized" for 401)
    was displayed when there was an HTTP error. I'm introducing a new error and I
    want the message to be more visible, so this at least makes it visible in the
    example client.
    
    Test Plan:
    Register a consumer in dev_appserver.
    Run /api/v1/user/students. It fails with 401 because the consumer isn't
    anointed, and the response message is displayed in the client (previously, it
    just said "Unauthorized").
    
    Reviewers: alpert
    
    Reviewed By: alpert
    
    Subscribers: ben
    
    Differential Revision: http://phabricator.khanacademy.org/D12243
Commits on Aug 23, 2013
  1. @robert3005

    Update lint_blacklist to include node_modules. Remove js_version.py f…

    robert3005 committed
    …rom source control
    
    Summary: Cosmetic fix, but it was bothering me a lot
    
    Test Plan:
    js_version.py is ignored and node_modules is not linted
    on commit
    
    Reviewers: csilvers, alpert
    
    Reviewed By: alpert
    
    Differential Revision: http://phabricator.khanacademy.org/D3712
  2. @robert3005

    Fix for google app engine truncating too long headers

    robert3005 committed
    Summary:
    This is an ugly hack which is necessary due to google app engine design. It is not stated anywhere directly but google app engine trims headers which are more than 498 bytes long (this number might be wrong). I have managed to dig out an old issue that mentions this but it is nowhere in official documentation. Anyway this is consistent with the behaviour I have observed where X-Original-Headers gets removed from the response. If you have any other suggestions how this might be avoided I will be more than happy to implement them. Also if you want to file a bug report with google then you're more than welcome.
    
    Remove function included for testing
    
    Test Plan:
    headers are present in the api response.
    
    <see below>
    
    Reviewers: alpert, csilvers
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3098
Commits on Jul 19, 2013
  1. @robert3005

    Merge pull request #55 from bcipolli/fix_test_example

    robert3005 committed
    updating changed 3rd party package refs
  2. updating changed 3rd party package refs

    Ben Cipollini committed
Commits on Jul 17, 2013
  1. @robert3005

    Minification process for javascript

    robert3005 committed
    Summary: Add minification build. Only minified file gets uploaded to production. We cannot load jquery from CDN on shim based config. It's a limitation of require.js. This way we only get minified file and require.js on the server. I think I have not messed up deployment and everything works.
    
    Test Plan: deploy and see if it works (don't change default!)
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    Differential Revision: http://phabricator.khanacademy.org/D3076
Commits on Jul 16, 2013
  1. @robert3005

    External libraries for new explorer

    robert3005 committed
    Summary: Because those had to go somewhere
    
    Reviewers: csilvers, alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3018
  2. @robert3005

    Config bits for appengine, require.js, requirements, etc.

    robert3005 committed
    Summary: Configuration files that bring everything together. I decide to use require.js to avoid lots of frustration from javascript poor dependency management. What is more it also allows asynchronous loading of dependencies in contrast to how browser would have done it. It's easy to replace it if necessary.
    
    Reviewers: csilvers, alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3016
  3. @robert3005

    React view to draw api call form

    robert3005 committed
    Summary: Draws api call form and handles submission and validation.
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3014
  4. @robert3005

    React view for a given endpoint

    robert3005 committed
    Summary: React view to represent one endpoint. Handles expanding.
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3013
  5. @robert3005

    Top documentation react view

    robert3005 committed
    Summary: Main documentation view and Loader that precedes it while loading
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3012
  6. @robert3005

    Root react views

    robert3005 committed
    Summary: Most top level react views that put everything together. There is also nice link hijacking handler that allows us to have normal links (without hash)
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3011
  7. @robert3005

    Router for api explorer - imitates anchor links without custom ids on…

    robert3005 committed
    … elements
    
    Summary: Router that handles link clicks. Due to the fact that React hijacks ids this is a bit of a hack.
    
    Test Plan: check that clicking on menu links actually moves you to a different place on a page
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3010
Commits on Jul 15, 2013
  1. @robert3005

    utility functions that don't belong to any particular class

    robert3005 committed
    Summary: Simple utility functions that are used by many views and don't belong to any particular model
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3009
  2. @robert3005

    Models and Backbone Helper of API Explorer

    robert3005 committed
    Summary: Rather simple backbone models with backbone mixin for react (taken from react examples).
    
    Test Plan: Creating PublicApi collection and populating it creates a Backbone representation of our api
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3008
  3. @robert3005

    Template and CSS styles for API Explorer

    robert3005 committed
    Summary: templates and css styles for api explorer. Most of the client side code is generated by javascript. Stylus is a superset of CSS so any valid css can be used in the stylesheet. I can replace it with raw css if that's desired, but the syntax is so much nicer.
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3007
  4. @robert3005

    Refactored backend code to work with requests and google app engine

    robert3005 committed
    Summary: Most of the program structure has been preserved. Mostly cases for handling different that GET requests have been added. Using requests makes code a lot less awkward.
    
    Reviewers: csilvers, alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3006
  5. @robert3005

    grunt based build system

    robert3005 committed
    Summary: First in the series of reviews of my new api explorer. Rest is coming up shortly. I have create task T1210 to keep reviews together. The first one introduces grunt based build system with npm packages to make it possible. npm install && grunt (having grunt-cli installed beforehand) should build the project and launch devappserver on 0.0.0.0:8080.
    
    Test Plan:
    grunt still produces expected result
    
    running "grunt deploy" builds and deploys the app
    
    Reviewers: alpert, joel
    
    Reviewed By: alpert
    
    CC: ben
    
    Maniphest Tasks: T1210
    
    Differential Revision: http://phabricator.khanacademy.org/D3005
Commits on Apr 8, 2013
  1. @spicyj

    Specify Python test client version in README

    spicyj committed
    Closes #49.
    
    Auditors: ben
Commits on Dec 9, 2012
  1. @nsfmc

    Correctly escape displayed json values and put response in window.API…

    nsfmc committed
    …_RESPONSE
    
    Summary: add window.API_RESPONSE variable which contains the preformated api response and some helpful tips on the homepage about it. The original rationale behind escaping the displayed json was that it's probably not so unfathomable that a person using the explorer would try to parse the #response_body variable, but it's actually not encoded correctly. In any way, to discourage that (and to encourage actually poking of the api) i'm exposing the response json in a variable which gets set after each call is made.
    
    Test Plan:
    $.parseJSON($("#response_body").text()) works.
    additionally, and more usefully, window.API_RESPONSE is available for perusing rather than mucking with #response_body.
    
    Reviewers: kamens
    
    Reviewed By: kamens
    
    Differential Revision: http://phabricator.khanacademy.org/D975
Commits on Aug 18, 2012
  1. @spicyj

    Escape URLs and parameters appropriately

    spicyj committed
    Reviewers: emily
    
    Reviewed By: emily
    
    Differential Revision: http://phabricator.khanacademy.org/D660
Something went wrong with that request. Please try again.