I'm pretty new to Apigee so apologies in advanced. We currently have an api which is accessed an Apigee proxy. From reading the Apigee best practices it looks like we should version the api in the URL like so
api/v1/endpoint/
How do I go about stripping the version out of the URL and using it to target the correct api?
Thanks
Rather than answering this with more theoretical content - I would suggest you try out the first sample - Add and configure your first API and you will be on your way to build your production API with good grip on how to use Apigee.
How do I go about stripping the version out of the URL and using it to target the correct api?
If you choose your base path to be "api/v1/endpoint/" like so:
<HTTPProxyConnection>
<BasePath>/api/v1/endpoint</BasePath>
<VirtualHost>default</VirtualHost>
</HTTPProxyConnection>
then only the part of the URL after /api/v1/endpoint will be sent to the target. In this way, you avoid passing along the version portion of the URL to your target.
Related
I want to use HTTP methods (GET/PUT/POST/DELETE) with an Azure resource and even have the URIs to do so. I understand that this practice utilizes RESTful web services.
What file type or programming language do I use to call these? On every documentation site that I have found, the only thing I see is something like the following, without any context:
Method Request URI
POST https://media.windows.net/api/Channels(‘*channelid*’)/Stop
So, where do I include this? HTML? C#? Do I create an ASP.NET web app and place it somewhere in there?
This would be very helpful to know so that I can utilize these methods!
You can use any programming language that has http support, or indeed your browser (most have native support to alter requests).
A more convenient alternative to test the api might be a rest client, a popular one being postman, a browser plugin.
Please help me to get/set metadata by REST API Calls.I am Using Alfresco 5.0 version.
Unfortunately the Alfresco REST API is limited to a small subset wich doesn't support (custom) metadata. Alfresco expects you use CMIS instead. Since CMIS may be too complicated / an overkill to integrate in your use case you could still create your own WebScripts to enable RESTful methods as you expect. This is straight forward. Take a look into the Web_Scripts_Examples and the official Web Scripts Documentation
You can find details of all existing rest api on below link
http://host:port/alfresco/service/index/all
If the api does not exist on above than you need to create your custom one.I am not sure about metadata.But you can find it on above link.
In my application architecture, I have a separate login service (REST API) which handles all user login/account related functionalities like creating user, authentication etc.
Right now on valid login I'm setting the appropriate session variables but these seems to be a bad approach.
Is there any way to create a custom service for
Meteor.loginWith<ExternalService>
The best place to start is with the packages ending in a service similar to the one you want to connect to. You would have to check the docs of the service you want to target based on the OAuth version (twitter uses OAuth 1, facebook uses OAuth 2).
Find out what OAuth version the service you want to target uses from the service's API docs and use a package that matches it the best with the names accounts-xxx
The packages are found at https://github.com/meteor/meteor/tree/devel/packages.
Additionally there are loads of accounts-xxx package on atmospherejs.com with github links. Most of these are based off the above too.
When you find a package that matches best to the service you want to target simply swap out the service names to the service you want.
The packages typically use accounts-oauth (https://github.com/meteor/meteor/tree/devel/packages/accounts-oauth) which is very thoroughly code commented if you want to go much further and understand everything that is going on in detail.
I want to show some part of my college site into my app (like news part only). Site is developed using JavaScript. Tell me how could I achieve this. I know Java quite well.
use jsoup and httpclient that's all you need
If you need javascript support, HtmlUnit is a very good solution for a headless browser. There also exists a framework that allows you to parallelize downloads over proxies using that: https://github.com/subes/invesdwin-webproxy
I'm trying to use R to grab some web data that requires OAuth authentication. Searching on CRAN and RSeek.org for info on OAuth + R provides nothing. Any tips for accessing RESTful APIs with R using OAuth?
I'm considering using some Python/Perl/Ruby to grab the data, save it to a text file, then work on it with R. I'd prefer to stay totally in R, but it seems like OAuth is a barrier.
Turns out Jeff Gentry from TwitteR wrote his own OAuth R library.
http://cran.r-project.org/web/packages/ROAuth/index.html
Best approach now appears to be to use httr (https://github.com/r-lib/httr)
One option I stumbled on is called OAuth Proxy and it slips the OAuth headers in using a proxy. This is an interesting kludge.
Another possible, assuming you have access to the required crypto functions in R, you can implement OAuth completely as HTTP requests without any lib support etc.
While writing a complete oauth lib might be asking too much, if you just need a quick and dirty way to pull down data, it shouldn't be too difficult to hand craft the few functions you need to complete an oauth request.
Also, while R may not have an oauth lib, most of the difficult part of oauth is in the interaction between servers, not in creating the tokens/requests, so you should be able to look at another language's implementation and port the required logic to R. I would suggest looking at a simple lib from http://oauth.net/code/ for a starting point.
It's possible to do this with the RCurl library as well. The main thing is that you parse the access_tokens and authorization verifications correctly. But I've managed to pull lots of data off of facebook with R via getURL.