Skip to main content
deleted 85 characters in body
Source Link
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60

NEXT: Relational QueriesRelational Queries

NEXT: Relational Queries

added 281 characters in body; deleted 133 characters in body
Source Link
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60
Source Link
Sky Sanders
  • 12.1k
  • 3
  • 32
  • 60

###Api Coverage

Every path in the API has a reciprocal query rooted on the Soapi.Domain.Site object.

The query syntax has been constructed to be as intuitive as possible.

A complete map of Soapi.JS2 query path to API rest path follows.

Api Routes

  • /answers/{id}
    site.Answers().ById(704).invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/answers/704
     
  • /answers/{id}/comments
    site.Answers().ById(704).Comments().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/answers/704/comments
  • /badges
    site.Badges().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/badgeshttp://api.stackapps.com/1.0/badges
     
  • /badges/{id}
    site.Badges().ById(9).invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/badges/9http://api.stackapps.com/1.0/badges/9
     
  • /badges/name
    site.Badges().ByName().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/badges/name
     
  • /badges/tags
    site.Badges().ByTags().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/badges/tags
     
  • /comments/{id}
    site.Comments().ById(1489).invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/comments/1489
     
  • /errors/{id}
    errors has a path on the ApiContext but is not exposed via Site
     
  • /posts/{id}/comments
    site.Posts().ById(704).Comments().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/posts/704/comments
     
  • /questions
    site.Questions().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/questions
     
  • /questions/{id}
    site.Questions().ById(386).invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/questions/386
     
  • /questions/{id}/answers
    site.Questions().ById(386).Answers().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/questions/386/answers
     
  • /questions/{id}/comments
    site.Questions().ById(386).Comments().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/questions/386/comments
     
  • /questions/{id}/timeline
    site.Questions().ById(386).Timeline().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/questions/386/timeline
     
  • /questions/Unanswered
    site.Questions().Unanswered().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/questions/unanswered
     
  • /Revisions/{id}
    site.Posts().ById(386).Revisions().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/revisions/386
     
  • /Revisions/{id}/{revisionguid}
    site.Posts().ById(386).Revisions().ByRevisionGuid("e452e755-a3fe-45d0-976f-e319ec460200").invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/revisions/386/e452e755-a3fe-45d0-976f-e319ec460200
     
  • /search
    site.Search().intitle("soapi.js").invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/search?intitle=soapi.js
     
  • /stats
    site.Stats().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/stats
     
  • /tags
    site.Tags().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/tags
     
  • /users
    site.Users().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users
     
  • /users/{id}
    site.Users().ById(14).invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14
     
  • /users/{id}/answers
    site.Users().ById(14).Answers().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/answers
     
  • /users/{id}/badges
    site.Users().ById(14).Badges().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/badges
     
  • /users/{id}/comments
    site.Users().ById(14).Comments().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/comments
     
  • /users/{id}/comments/{toid}
    site.Users().ById(14).CommentsTo(18).invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/comments/18
     
  • /users/{id}/favorites
    site.Users().ById(14).Favorites().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/favorites
     
  • /users/{id}/mentioned
    site.Users().ById(14).Mentioned().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/mentioned
     
  • /users/{id}/questions
    site.Users().ById(14).Questions().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/questions
     
  • /users/{id}/reputation
    site.Users().ById(14).Reputation().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/reputation
     
  • /users/{id}/tags
    site.Users().ById(14).Tags().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/tags
     
  • /users/{id}/timeline
    site.Users().ById(14).Timeline().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/14/timeline
     
  • /users/moderators
    site.Moderators().invoke(/*handlers here*/);
    http://api.stackapps.com/1.0/users/moderators
     

StackAuth Routes

  • /sites - always available after ApiContext initialization
    ctx.sites;
    http://stackauth.com/1.0/sites
     
  • /users/{id}/associated
    site.Users().ByIdAssociated("e58345f5-0f7b-4261-b449-3959c596f91f").invoke(/*handlers here*/);
    http://stackauth.com/1.0/users/e58345f5-0f7b-4261-b449-3959c596f91f/associated