Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Create API Based Web Service In Symfony2

I am trying to create a API based service using Symfony2 which is the main framework our company tends to work on. I am told to research the best way to create a web service, i.e: REST, SOAP, etc. I am not a very experienced programmer. I am just trying to research the subject matter.

What we basically need is a system that would provide and API to make other apps on any platform or device. For example: I can use the Twitter API to post/fetch tweets. In the same way we are trying to create a E-comm product that would help other users to build sites and apps above the platform regardless of the programming language, device or OS.

We are trying to convert our product into an API based service from a pure "MVC application".

like image 935
Kunwar Siddharth Singh Avatar asked Jun 08 '12 12:06

Kunwar Siddharth Singh


People also ask

Can we create API in PHP?

There are many great frameworks that can help you build REST APIs quickly. Laravel/Lumen and Symfony's API platform are the most often used examples in the PHP ecosystem. They provide great tools to process requests and generate JSON responses with the correct HTTP status codes.

What is Symfony API?

What is Symfony? Symfony is a PHP framework used to develop web application, APIs, microservices and web services. Symfony is one of the leading PHP framework for creating websites and web application.


2 Answers

Check the this article REST APIs with Symfony2: The Right Way by William Durand about Designing a REST API.

like image 147
HVKotak Avatar answered Oct 19 '22 03:10

HVKotak


I think the best repo you could look at is at:

https://github.com/lsmith77/symfony-rest-edition

this is a tutorial

http://welcometothebundle.com/symfony2-rest-api-the-best-2013-way/

like image 2
liuggio Avatar answered Oct 19 '22 02:10

liuggio