How do we test RESTful APIs which use OAuth 2.0 using robot framework?
Do we have any keywords available? So far I have used HTTP Basic authentication which is very simple.
Please let me know if there is already have implementation for this.
You can use any general-purpose HTTP Requests calls or libs to do OAuth, as long as you set the credentials in the Authorization header. See How to make a POST (ReST) API in Robot framework with for more info.
Related
I tried to look up information about this but couldn't find much. I've previously used Firebase for user registration, but now I have to do a project using Postman. Are there any resources where I can learn to POST to Postman using Swift?
I believe what you mean to say is - You have previously worked with Swift and Firebase but not with Swift and REST APIs (Not Postman). Postman is only a client for making HTTP requests to REST, SOAP, or Graph API services. Unlike Firebase ( a Backend as a service ), working with APIs and HTTP Requests (POST, GET, etc) in your application requires a bit more effort.
What you need to research is how to work with REST APIs in Swift.
Here are some resources that might be helpful:
How to Make Your First API call in Swift
How to Make HTTP Request with URLSession in Swift
Creating A REST API Manager in Swift
Can anyone provide direction on how to add a Rest API to an existing Azure .net website as an alternative to receive private information? Like many website, we already have good U&P authentication via .Net Identity Framework over SSL to protect the U&P and content.
There are a lot of .net C# websites that have implemented the .net U&P framework that works great over SSL. With the proliferation of Rest APIs, we need to provide these users capability to login with their already existing credentials via Rest API so how can we simply extend this?
I am going thru the documentation and examples related to calling REST APIs for SugarCRM using Chrome REST client or PostMan but most of the examples are PHP and I am not finding a good way to find a proper request and other parameters to be mentioned so that I can get the successful response from the API. I was trying get_entry_list. Can someone please help by providing a working REST API request for this API which I can run on REST client or postman?
I also would like to know if I want to build a SugarCRM connector for my application, which set of APIs I should use? Should I go with REST or SOAP and any supporting arguments to choose one over another?
Thanks
I have to create 2 different websites that would use REST api to interact with a single MySQL database.
I know how to create website with forms..etc using PHP.
How would I use REST api for my websites.I searched and found out that there are libraries for android to use REST api but how to do so in case of a website ?
REST is a architectural pattern, it is not (by itself) an API. APIs can implement REST.
Just like any other API out there, you have to get the documentation for the API and then call it from your source.
Depending on what your requirements are, you may be calling it from javascript or from your PHP backend.
REST is an architecture pattern (you can read more about it at wikipedia) which aims to use HTTP verbs like PUT, POST and DELETE to execute commands against endpoints which represent a resource.
To use REST, your backend server will send normal HTTP requests to the API service; so in PHP this means using the various curl libraries to send requests.
Responses are generally in json; but they could be in any other format (or even in binary) - check with the API documentation that you have to consume.
If all you want is interacting with a REST API, then you need a HTTP client, probably cURL (PHP has a cURL lib). After that you have to check whether your API violates the HATEOAS constraint. If not, then it is called hypermedia API. In that case you have to follow hyperlinks provided by the API in the responses. If it violates the constraint, then it is called web API, and you have to build the method, URL, etc... on the client side again, so your client will break easily by any structural changes of the API. Everything else depends on the message format and the semantic annotations the API uses.
If you want to build a REST API, I strongly suggest you to learn more about the topic. First read the Fielding diessertation and check some existing solutions like HAL or Hydra+JSON-LD. Forget the tutorials. Most information available on the web about how to implement a REST API is flawed.
I am a total noob in Scala, I am just learning. So I am writing a server in Scala and I need to login to Github to access a repository. Are there any libraries that implement an OAuth consumer that I could use? I come from Ruby, and there is Warden that I used in the past. I am looking for something like that...
There are two versions of OAuth, OAuth 1 and OAuth 2. Github uses OAuth 2. The Play Framework authors, for one, consider OAuth 2 sufficiently simple to implement yourself that they don't provide a helper for it.
However, Google says:
"Given the security implications of getting the implementation correct, we strongly encourage developers to use OAuth 2.0 libraries when interacting with Google's OAuth 2.0 endpoints"
(I know Github isn't a Google endpoint, but this security point is valid for any website protected by OAuth.) And Google provides a generic OAuth 2 client for Java, and because Java code can be called from Scala, you can use that.
However, note that certain Github API calls (I think it's ones that access public repositories) don't require any authentication.
You will, however, need to set the User-Agent header to the name of your application in each HTTP request.