Commit 8e962434 authored by Michael Lussier's avatar Michael Lussier Committed by Kati Paizee

Include basic example at start of REST API documentation

parent 47ab3dd0
...@@ -12,6 +12,9 @@ Use the GitLab APIs to automate GitLab. ...@@ -12,6 +12,9 @@ Use the GitLab APIs to automate GitLab.
A REST API is available in GitLab. A REST API is available in GitLab.
Usage instructions are below. Usage instructions are below.
For examples, see [How to use the API](#how-to-use-the-api).
For a list of the available resources and their endpoints, see For a list of the available resources and their endpoints, see
[REST API resources](api_resources.md). [REST API resources](api_resources.md).
...@@ -76,7 +79,7 @@ For example, the root of the v4 API is at `/api/v4`. ...@@ -76,7 +79,7 @@ For example, the root of the v4 API is at `/api/v4`.
### Valid API request ### Valid API request
If you have a GitLab instance at `gitlab.example.com`: The following is a basic example of a request to the fictional `gitlab.example.com` endpoint:
```shell ```shell
curl "https://gitlab.example.com/api/v4/projects" curl "https://gitlab.example.com/api/v4/projects"
...@@ -85,6 +88,10 @@ curl "https://gitlab.example.com/api/v4/projects" ...@@ -85,6 +88,10 @@ curl "https://gitlab.example.com/api/v4/projects"
The API uses JSON to serialize data. You don't need to specify `.json` at the The API uses JSON to serialize data. You don't need to specify `.json` at the
end of the API URL. end of the API URL.
NOTE:
In the example above, replace `gitlab.example.com` with `gitlab.com` to query GitLab.com (GitLab SaaS).
Access can be denied due to authentication. For more information, see [Authentication](#authentication).
### API request to expose HTTP response headers ### API request to expose HTTP response headers
If you want to expose HTTP response headers, use the `--include` option: If you want to expose HTTP response headers, use the `--include` option:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment