> For the complete documentation index, see [llms.txt](https://cathy-thy.gitbook.io/drupal-9/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cathy-thy.gitbook.io/drupal-9/custom-modules/custom-restful-api/sample-code-get-v1.md). Agents can also search and read this documentation through its [MCP server](https://cathy-thy.gitbook.io/drupal-9/~gitbook/mcp).

# Sample Code - GET v1

GET v1 only return static message when you raise GET request.

{% embed url="<https://github.com/cathy-thy/d9-demo/tree/main/custom/my_custom_rest_api>" %}

### 1. Folder Structure

### 2. Code Analysis&#x20;

Your only need one php file to create your REST API.&#x20;

It's a simple example, after it is enable, you should see message "**Your custom REST API is activated**." when you try to raise GET request.
