API Platform Documentation

The Distribution: Create Powerful APIs with Ease

  1. Getting Started with API Platform: Hypermedia and GraphQL API, Admin and Progressive Web App
    1. Installing the Framework
    2. It's Ready!
    3. Bringing your Own Model
    4. Validating Data
    5. Adding GraphQL Support
    6. The Admin
    7. A React/Redux Progressive Web App
    8. Other Features
  2. Testing and Specifying the API
    1. Creating Data Fixtures
    2. Writing Functional Tests
    3. Writing Unit Tests
  3. Debugging
    1. Add a Development Stage to the Dockerfile
    2. Configure Xdebug with Docker Compose Override
    3. Troubleshooting

The API Component

  1. The API Platform Core Library
    1. Features
    2. Other resources
  2. Getting started
    1. Installing API Platform Core
    2. Before Reading this Documentation
    3. Mapping the Entities
  3. Operations
    1. Enabling and Disabling Operations
    2. Configuring Operations
    3. Subresources
    4. Creating Custom Operations and Controllers
  4. Filters
    1. Doctrine ORM and MongoDB ODM Filters
    2. Elasticsearch Filters
    3. Serializer Filters
    4. Creating Custom Filters
    5. ApiFilter Annotation
  5. The Serialization Process
    1. Overall Process
    2. Available Serializers
    3. The Serialization Context, Groups and Relations
    4. Using Serialization Groups
    5. Using Serialization Groups per Operation
    6. Changing the Serialization Context Dynamically
    7. Changing the Serialization Context on a Per-item Basis
    8. Name Conversion
    9. Decorating a Serializer and Adding Extra Data
    10. Entity Identifier Case
    11. Embedding the JSON-LD Context
    12. Collection Relation
  6. Validation
    1. Validating Submitted Data
    2. Using Validation Groups
    3. Using Validation Groups on Operations
    4. Dynamic Validation Groups
    5. Error Levels and Payload Serialization
    6. Validation on Collection Relations
    7. Open Vocabulary Generated from Validation Metadata
  7. Security
    1. Configuring the Access Control Message
  8. Data Providers
    1. Custom Collection Data Provider
    2. Custom Item Data Provider
    3. Injecting the Serializer in an ItemDataProvider
    4. Injecting Extensions (Pagination, Filter, EagerLoading etc.)
  9. Pagination
    1. Disabling the Pagination
    2. Changing the Number of Items per Page
    3. Changing Maximum items per page
    4. Partial Pagination
    5. Controlling the behavior of the Doctrine ORM Paginator
    6. Custom Controller Action
  10. The Event System
    1. Built-in Event Listeners
    2. Custom Event Listeners
  11. Content Negotiation
    1. Enabling Several Formats
    2. Enabling Additional Formats On a Specific Resource/Operation
    3. Registering a Custom Serializer
    4. Writing a Custom Normalizer
  12. Performance and Cache
    1. Enabling the Built-in HTTP Cache Invalidation System
    2. Setting Custom HTTP Cache Headers
    3. Enabling the Metadata Cache
    4. Using PPM (PHP-PM)
    5. Doctrine Queries and Indexes
    6. Profiling with Blackfire.io
  13. Extensions
    1. Custom Doctrine ORM Extension
    2. Custom Doctrine MongoDB ODM Extension
    3. Custom Elasticsearch Extension
  14. OpenAPI Specification Support (formerly Swagger)
    1. Using the OpenAPI Command
    2. Overriding the OpenAPI Specification
    3. Using the OpenAPI and Swagger Contexts
    4. Changing the Name of a Definition
    5. Changing Operations in the OpenAPI Documentation
    6. Changing the Location of Swagger UI
    7. Overriding the UI Template
    8. Compatibilily Layer with Amazon API Gateway
  15. Overriding Default Order
  16. Using External Vocabularies
  17. Operation Path Naming
    1. Configuration
    2. Create a Custom Operation Path Resolver
  18. Extending JSON-LD Context
  19. Accept application/x-www-form-urlencoded Form Data
    1. Create your DeserializeListener Decorator
    2. Creating the Service Definition
  20. JWT Authentication
    1. Installing LexikJWTAuthenticationBundle
    2. Configuring the Symfony SecurityBundle
    3. Documenting the Authentication Mechanism with Swagger/Open API
    4. Testing with Behat
  21. AngularJS Integration
    1. Restangular
    2. ng-admin
  22. FOSUserBundle Integration
    1. Installing the Bundle
    2. Enabling the Bridge
    3. Creating a User Entity with Serialization Groups
  23. NelmioApiDocBundle Integration
  24. Configuration
  25. Data Persisters
    1. Creating a Custom Data Persister
  26. Deprecating Resources and Properties (Alternative to Versioning)
    1. Deprecating Resource Classes, Operations and Properties
    2. Setting the Sunset HTTP Header to Indicate When a Resource or an Operation Will Be Removed
  27. General Design Considerations
  28. Using Data Transfer Objects (DTOs)
    1. Specifying an Input or an Output Data Representation
    2. Updating a Resource with a Custom Input
    3. Disabling the Input or the Output
    4. Input/Output Metadata
    5. Using Objects As Relations Inside Resources
    6. Validating Data Transfer Objects
  29. Elasticsearch Support
    1. Overview
    2. Enabling Reading Support
    3. Creating Models
    4. Filtering
    5. Creating Custom Extensions
  30. Errors Handling
    1. Converting PHP Exceptions to HTTP Errors
  31. Handling File Upload
    1. Installing VichUploaderBundle
    2. Configuring the Entity Receiving the Uploaded File
    3. Handling File Upload
    4. Resolving the File URL
    5. Making a Request to the /media_objects Endpoint
    6. Linking a MediaObject Resource to Another Resource
  32. GraphQL Support
    1. Overall View
    2. Enabling GraphQL
    3. GraphiQL
    4. Queries
    5. Mutations
    6. Filters
    7. Security (access_control)
    8. Serialization Groups
  33. Identifiers
    1. Custom Identifier Normalizer
    2. Supported Identifiers
  34. Pushing Live Updates Using the Mercure Protocol
    1. Installing the Mercure Support
    2. Pushing the API Updates
    3. Dispatching Private Updates (Authorized Mode)
  35. Symfony Messenger Integration: CQRS and Async Message Processing
    1. Installing Symfony Messenger
    2. Dispatching a Resource through the Message Bus
    3. Registering a Message Handler
    4. Accessing the Data Returned by the Handler
    5. Detecting Removals
    6. Using Messenger with an Input Object
  36. MongoDB Support
    1. Overview
    2. Enabling MongoDB Support
    3. Creating Documents
    4. Filtering
    5. Creating Custom Extensions
  37. Pushing Related Resources Using HTTP/2

The Schema Generator Component

  1. The Schema Generator
    1. What Is Schema.org?
    2. Why Use Schema.org Data to Generate a PHP Model?
    3. Documentation
  2. Getting Started
    1. Installation
    2. Model Scaffolding
    3. Cardinality Extraction
  3. Configuration
    1. Customizing PHP Namespaces
    2. Forcing a Field Range
    3. Forcing a Field Cardinality
    4. Forcing a Relation Table Name
    5. Forcing (or Disabling) a Class Parent
    6. Forcing a Class to be Abstract
    7. Forcing a Nullable Property
    8. Forcing a Unique Property
    9. Making a Property Read-Only
    10. Making a Property Write-Only
    11. Forcing a Property to be in a Serialization Group
    12. Forcing an Embeddable Class to be Embedded
    13. Author PHPDoc
    14. Disabling Generators and Creating Custom Ones
    15. Skipping Accessor Method Generation
    16. Disabling the id Generator
    17. Generating UUIDs
    18. User submitted UUIDs
    19. Generating Custom IDs
    20. Disabling Usage of Doctrine Collections
    21. Changing the Field Visibility
    22. Generating @Assert\Type Annotations
    23. Forcing Doctrine Inheritance Mapping Annotation
    24. Interfaces and Doctrine Resolve Target Entity Listener
    25. Custom Schemas
    26. Checking GoodRelation Compatibility
    27. PHP File Header
    28. Full Configuration Reference

The Admin Component

  1. The API Platform Admin
    1. Features
  2. Getting Started
    1. Installation
    2. Creating the Admin
    3. Customizing the Admin
  3. Authentication Support
  4. Handling Relations to Collections
    1. Customizing a Property
    2. Customizing an Icon
    3. Using an Autocomplete Input for Relations
  5. Customizing the Admin
    1. Preparing your App
    2. Customizing Inputs
    3. Customizing Fields
    4. "Free" Mode
    5. Reusing the Default Layout

The Client Generator Component

  1. The API Platform Client Generator
    1. Features
  2. React Generator
    1. Install
    2. Generating a Progressive Web App
    3. Screenshots
  3. Vue.js Generator
  4. Troubleshooting
  5. Next.js Generator
    1. Install
    2. Starting the Project
    3. Generating Routes
    4. Screenshots
  6. Quasar Framework Generator
  7. React Native generator
    1. Install
    2. Generating a Native App
    3. Screenshots in iOS Simulator
  8. Typescript Interfaces
    1. Example

Deployment

  1. Deploying API Platform Applications
  2. Deploying an API Platform App on Heroku
  3. Deploying to a Kubernetes Cluster
    1. Preparing Your Cluster and Your Local Machine
    2. Creating and Publishing the Docker Images
    3. Deploying
    4. Initializing the Database
    5. Tiller RBAC Issue
  4. Implement Traefik Into API Platform Dockerized
    1. Basic Implementation
    2. Known Issues
    3. Going Further

Extra

  1. API Platform's Philosophy
  2. Troubleshooting
    1. Using Docker
    2. Using API Platform and JMS Serializer in the same project
    3. "upstream sent too big header while reading response header from upstream" 502 Error
  3. Contribution guides
  4. Contributor Code of Conduct
  5. The Release Process