|
Unfortunately, we run a pretty lean shop here at CodeProject Central and I'm working on some performance and scalability improvements for the main site.
These changes may/will affect the API, so I'm holding off on any non-critical or non-trivial changes.
I saw your other post, and it looks like you want me to implement OData plus a couple of new APIs.
I've got it bookmarked for when I get time to work on new stuff for the API.
|
|
|
|
|
The API downloads appear to be out of action. I just tried to download various .zip files but they are all coming up with FNF errors.
|
|
|
|
|
Do you mean downloading the samples? I can download them fine.
The quick red ProgramFOX jumps right over the Lazy<Dog> .
|
|
|
|
|
Hmm. Definitely not working for me. I will wait a bit and try again.
|
|
|
|
|
Well that was odd. I had to log out and log back in to download the samples.
|
|
|
|
|
Glad it is working again.
Just to understand what went wrong, what browser & version are you using?
|
|
|
|
|
Latest version of Chrome on Windows 8.1.
|
|
|
|
|
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:
"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:
<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:
{
"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.
|
|
|
|
|
Hi,
I just thought to share with you a sample application with a portable library for CodeProject API Wrapper.
C# CodeProject API Wrapper[^]
Ranjan.D
|
|
|
|
|
Hi,
I just have a small question on non-redirect OAuth Flow.
I have registered in CodeProject Web API Client Settings with a dummy HTTPS URL.
When I am using the client id and secret key with in a console application, I do get the access token but while making a request, say to get my articles, the request fails with a Unauthorized Access.
Currently it works only for other API's that is the general CodeProject API but it's failing for My API.
Thanks,
Ranjan.D
modified 21-Feb-15 17:58pm.
|
|
|
|
|
|
Currently as I understood there's no way to filter the articles by date range when we are using GetArticles API.
Could you incorporate the article filtering by created and/or modified date in addition to other filters?
I will be happy to see these changes. I would rather use it in IOT Challenge
Thanks,
Ranjan.D
modified 12-Feb-15 17:43pm.
|
|
|
|
|
Hi,
I'm trying to get an access token and sends a request for authorization:
https://api.codeproject.com/Account/Authorize?client_id=92mWWELc2DjcL-6tu7L1Py6yllleqSCt&redirect_uri=http%3A%2F%2Foauthproxy.nemiro.net%2F&response_type=code
But the server returns an error:
invalid_request
Why?
PS: For demo data no errors:
https://api.codeproject.com/Account/Authorize?client_id=JkOnJ9zIQ1vWvP3FvsJVx-3iOnSd-6a-&redirect_uri=https%3A%2F%2Fapi.codeproject.com%2FSamples%2FMyApi%2F&response_type=code
Docendo Discimus
|
|
|
|
|
Your redirect url must start with https:// for security reasons.
|
|
|
|
|
Yes! It works!
Thanks!
Docendo Discimus
|
|
|
|
|
When fetching the newest questions through the API, for 5/25 questions, the author name was empty and the ID was 0:
[{"name":"","id":0}]
That's weird, because I checked and the user accounts are not deleted or something.
It seems like all members with the name "Member NNNNNN" are returned like this.
The quick red ProgramFOX jumps right over the Lazy<Dog> .
|
|
|
|
|
I'll have a look when I get back from vacation on Monday.
|
|
|
|
|
Have you been able to find the cause? I'm still encountering the issue.
The quick red ProgramFOX jumps right over the Lazy<Dog> .
|
|
|
|
|
It's a PureBasic language.
Who can I contact with that?
Or I want too much?
P.S. Language isn't so new It's new for CodeProject.
|
|
|
|
|
|
I decided to do a single HTML page that displays answer statistics, using the API (it's for fun, to get the idea of the APIs)...
Gone to register a secret key, but the Redirect URL, got me...
What it's about?
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
As explained in the documentation, the CodeProject API uses OAuth 2 for Authorization. The redirect URL is the URL that you want the Authorization Server to redirect to, once it has asked CodeProject to Authenticate the user.
There is a link in the documentation to the OAuth 2 specification that explains this better than I can in a message.
If you plan to use one of the Flows that do not use browser redirection, then any valid url will do. Keep in mind that we may be removing the non-redirect Flows for security reasons.
|
|
|
|
|
Thank you...
What are you saying here, that I can not create a single-page, non-hosted HTML/JavaScript application...Or even a JavaScript based Chrome extension...
I consider it as a lack of possibilities...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Please look at any of the first four samples at [^].
These don't use the redirect URL. Just enter any valid https URL when you register.
Matthew
|
|
|
|
|
I'm working on an application using the API that checks every 30 seconds whether there are new questions posted and if yes, it shows a notification balloon. But now I thought that it might not work if API data is cached for a long time, so I'm asking that here now.
Is API data cached? And if yes, for how long?
The quick red ProgramFOX jumps right over the Lazy<Dog> .
|
|
|
|