Click here to Skip to main content
15,890,186 members
Home / Discussions / CodeProject API
   

CodeProject API

 
QuestionWhat is "ContentType" in ItemSummary? Pin
Thomas Daniels3-Nov-15 23:41
mentorThomas Daniels3-Nov-15 23:41 
AnswerRe: What is "ContentType" in ItemSummary? Pin
Matthew Dennis9-Nov-15 2:04
sysadminMatthew Dennis9-Nov-15 2:04 
GeneralApi is again down and its very frequent Pin
maq_rohit9-Aug-15 19:00
professionalmaq_rohit9-Aug-15 19:00 
GeneralRe: Api is again down and its very frequent Pin
Chris Maunder11-Aug-15 4:03
cofounderChris Maunder11-Aug-15 4:03 
GeneralPlease, give us the article body and downloads... Pin
Pete O'Hanlon21-May-15 2:58
mvePete O'Hanlon21-May-15 2:58 
GeneralRe: Please, give us the article body and downloads... Pin
Pete O'Hanlon10-Dec-15 0:35
mvePete O'Hanlon10-Dec-15 0:35 
GeneralRe: Please, give us the article body and downloads... Pin
Matthew Dennis10-Dec-15 4:46
sysadminMatthew Dennis10-Dec-15 4:46 
GeneralRe: Please, give us the article body and downloads... Pin
Brisingr Aerowing10-Dec-15 9:46
professionalBrisingr Aerowing10-Dec-15 9:46 
GeneralRe: Please, give us the article body and downloads... Pin
Thomas Daniels17-Dec-15 22:47
mentorThomas Daniels17-Dec-15 22:47 
GeneralRe: Please, give us the article body and downloads... Pin
Matthew Dennis10-Dec-15 5:31
sysadminMatthew Dennis10-Dec-15 5:31 
GeneralRe: Please, give us the article body and downloads... Pin
Pete O'Hanlon10-Dec-15 7:32
mvePete O'Hanlon10-Dec-15 7:32 
General404 when passing number as Mode Pin
Thomas Daniels14-May-15 23:23
mentorThomas Daniels14-May-15 23:23 
GeneralRe: 404 when passing number as Mode Pin
Matthew Dennis15-May-15 6:09
sysadminMatthew Dennis15-May-15 6:09 
GeneralTypo at page of ReputationTypeViewModel Pin
Thomas Daniels10-May-15 7:01
mentorThomas Daniels10-May-15 7:01 
GeneralFor your viewing pleasure ... Pin
Matthew Dennis12-Apr-15 11:22
sysadminMatthew Dennis12-Apr-15 11:22 
GeneralRe: For your viewing pleasure ... Pin
Mario Z12-Apr-15 22:35
professionalMario Z12-Apr-15 22:35 
GeneralRe: For your viewing pleasure ... Pin
Matthew Dennis13-Apr-15 5:45
sysadminMatthew Dennis13-Apr-15 5:45 
NewsFailing downloads Pin
Pete O'Hanlon11-Apr-15 21:05
mvePete O'Hanlon11-Apr-15 21:05 
GeneralRe: Failing downloads Pin
Thomas Daniels11-Apr-15 22:01
mentorThomas Daniels11-Apr-15 22:01 
GeneralRe: Failing downloads Pin
Pete O'Hanlon11-Apr-15 22:10
mvePete O'Hanlon11-Apr-15 22:10 
GeneralRe: Failing downloads Pin
Pete O'Hanlon12-Apr-15 21:53
mvePete O'Hanlon12-Apr-15 21:53 
GeneralRe: Failing downloads Pin
Matthew Dennis13-Apr-15 5:40
sysadminMatthew Dennis13-Apr-15 5:40 
GeneralRe: Failing downloads Pin
Pete O'Hanlon13-Apr-15 5:42
mvePete O'Hanlon13-Apr-15 5:42 
GeneralSome suggestions for API enhancements PinPopular
Mario Z10-Apr-15 9:58
professionalMario Z10-Apr-15 9:58 
I'm currently working on small POC website that shows CodeProject member's Q&A tags statistic (if interested it is available here) and while building it I collected few suggestions which I hope you'll find interesting and/or useful.

- First the easy one, in API documentations on few places the CodeProject APIs are referred as HTML services.
I think this should be HTTP services or better jet RESTful services.

- Somewhat common practice for defining a response's format is to add a format's extension termination on the URL to identify data type you want to request from the server, for example like the following:
v1/my/articles.xml?page={page}
v1/my/articles.json?page={page}

Now whether this is truly a RESTful approach or a best practice is debatable, but as it is now there is a problem of mixing two conventions. You see the versioning does not follow the convention that setting the result format uses. In order for versioning to follow the same convention (a true RESTful approach) it should also be defined in Media Type header, for example like the following:
"application/json;application&v=1"

Nevertheless I must say I don't see any downfall in supporting both approaches, as long as the priorities and the used default values are documented.

- Regarding the MY API, most (if not all) of these currently available GET APIs are publicly available resources. I mean every CodeProject member can look at the other member's Questions, Answers, Articles, etc. so it just feels natural to me that Client Credentials Grant should be required here, not Authorization Code Grant.
Nevertheless I'm not suggesting to change the current MY API (because I presume it is likely that you want to add follow-up PUT, POST, etc. APIs here), instead I'm suggesting to add something like the following:
v1/{userId}/answers?page={page}
v1/{userId}/articles?page={page}

And this API should work on Client Credentials Grant or Implicit Grant flow.

- Regarding the pagination, pageSize should definitely be available for querying together with page and you could specify the pageSize value limitation in the documentation.
So something like this should be supported:
v1/my/answers?page={page}&pageSize={pageSize}

Also I believe a very useful thing could be to provide First, Last, Next and Previous resource locations in PaginationInfo so that the pagination can be processed continuously from the response itself.
For example for the following API:
v1/my/answers?page=3

Could result into something like the following:
JavaScript
"pagination": {
    "page": 3,
    "pageSize": 25,
    "totalPages": 5,
    "totalItems": 25,
    "first" : { "href" : "https://api.codeproject.com/v1/my/answers?page=1" },
    "prev" : { "href" : "https://api.codeproject.com/v1/my/answers?page=2" },
    "next" : { "href" : "https://api.codeproject.com/v1/my/answers?page=4" },
    "last" : { "href" : "https://api.codeproject.com/v1/my/answers?page=5" },
}

Or maybe something like this:
HTML
<Pagination>
    <Page>3</Page>
    <PageSize>25</PageSize>
    <TotalPages>5</TotalPages>
    <TotalItems>25</TotalItems>
    <link rel="first" href="https://api.codeproject.com/v1/my/answers?page=1" />
    <link rel="prev" href="https://api.codeproject.com/v1/my/answers?page=2" />
    <link rel="next" href="https://api.codeproject.com/v1/my/answers?page=4" />
    <link rel="last" href="https://api.codeproject.com/v1/my/answers?page=5" />
</Pagination>


- Partial returned result, so instead of receiving a full result and filtering out the necessary data we could do something like this:
v1/my/answers?page=3&fields=pagination(totalItems),items(id,summary)

And receive only the following:
JavaScript
{
  "pagination": {
    "totalItems": 2
  },
  "items": [
    {
      "id": "100",
	  "summary": "First sample item."
	},
    {
      "id": "200",
	  "summary": "Second sample item."
	}
  ]
}


I hope any of these you will find useful, if you don't mind these type of suggestions let me know and I will continue collecting them and posting here afterword.
GeneralAPI Abstraction Pin
Ranjan.D23-Feb-15 3:58
professionalRanjan.D23-Feb-15 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.