Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8e962434
Commit
8e962434
authored
Feb 04, 2022
by
Michael Lussier
Committed by
Kati Paizee
Feb 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include basic example at start of REST API documentation
parent
47ab3dd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
doc/api/index.md
doc/api/index.md
+8
-1
No files found.
doc/api/index.md
View file @
8e962434
...
...
@@ -12,6 +12,9 @@ Use the GitLab APIs to automate GitLab.
A REST API is available in GitLab.
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
[
REST API resources
](
api_resources.md
)
.
...
...
@@ -76,7 +79,7 @@ For example, the root of the v4 API is at `/api/v4`.
### 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
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
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
If you want to expose HTTP response headers, use the
`--include`
option:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment