@@ -194,13 +194,13 @@ You can use a [personal access token][pat] to authenticate with the API by passi
194
194
Example of using the personal access token in a parameter:
195
195
196
196
``` shell
197
- curl https://gitlab.example.com/api/v4/projects? private_token=9koXpg98eAheJpvBs5tK
197
+ curl https://gitlab.example.com/api/v4/projects? private_token=< your_access_token >
198
198
```
199
199
200
200
Example of using the personal access token in a header:
201
201
202
202
``` shell
203
- curl --header " Private-Token: 9koXpg98eAheJpvBs5tK " https://gitlab.example.com/api/v4/projects
203
+ curl --header " Private-Token: <your_access_token> " https://gitlab.example.com/api/v4/projects
204
204
```
205
205
206
206
Read more about [ personal access tokens] [ pat ] .
@@ -319,22 +319,22 @@ Example of a valid API call and a request using cURL with sudo request,
319
319
providing a username:
320
320
321
321
```
322
- GET /projects?private_token=9koXpg98eAheJpvBs5tK &sudo=username
322
+ GET /projects?private_token=<your_access_token> &sudo=username
323
323
```
324
324
325
325
```shell
326
- curl --header "Private-Token: 9koXpg98eAheJpvBs5tK " --header "Sudo: username" "https://gitlab.example.com/api/v4/projects"
326
+ curl --header "Private-Token: <your_access_token> " --header "Sudo: username" "https://gitlab.example.com/api/v4/projects"
327
327
```
328
328
329
329
Example of a valid API call and a request using cURL with sudo request,
330
330
providing an ID:
331
331
332
332
```
333
- GET /projects?private_token=9koXpg98eAheJpvBs5tK &sudo=23
333
+ GET /projects?private_token=<your_access_token> &sudo=23
334
334
```
335
335
336
336
``` shell
337
- curl --header " Private-Token: 9koXpg98eAheJpvBs5tK " --header " Sudo: 23" " https://gitlab.example.com/api/v4/projects"
337
+ curl --header " Private-Token: <your_access_token> " --header " Sudo: 23" " https://gitlab.example.com/api/v4/projects"
338
338
```
339
339
340
340
## Status codes
@@ -383,7 +383,7 @@ resources you can pass the following parameters:
383
383
In the example below, we list 50 [ namespaces] ( namespaces.md ) per page.
384
384
385
385
``` bash
386
- curl --request PUT --header " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK " " https://gitlab.example.com/api/v4/namespaces?per_page=50
386
+ curl --request PUT --header " PRIVATE-TOKEN: <your_access_token> " " https://gitlab.example.com/api/v4/namespaces?per_page=50
387
387
` ` `
388
388
389
389
# ## Pagination Link header
@@ -397,7 +397,7 @@ and we request the second page (`page=2`) of [comments](notes.md) of the issue
397
397
with ID ` 8` which belongs to the project with ID ` 8` :
398
398
399
399
` ` ` bash
400
- curl --head --header " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK " https://gitlab.example.com/api/v4/projects/8/issues/8/notes?per_page=3&page=2
400
+ curl --head --header " PRIVATE-TOKEN: < your_access_token > " https://gitlab.example.com/api/v4/projects/8/issues/8/notes?per_page=3&page=2
401
401
` ` `
402
402
403
403
The response will then be:
@@ -465,7 +465,7 @@ We can call the API with `array` and `hash` types parameters as shown below:
465
465
` import_sources` is a parameter of type ` array` :
466
466
467
467
` ` ` bash
468
- curl --request POST --header " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK " \
468
+ curl --request POST --header " PRIVATE-TOKEN: < your_access_token > " \
469
469
-d " import_sources[]=github" \
470
470
-d " import_sources[]=bitbucket" \
471
471
" https://gitlab.example.com/api/v4/some_endpoint
@@ -476,7 +476,7 @@ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \
476
476
` override_params ` is a parameter of type ` hash ` :
477
477
478
478
``` bash
479
- curl --request POST --header " PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK " \
479
+ curl --request POST --header " PRIVATE-TOKEN: <your_access_token> " \
480
480
--form " namespace=email" \
481
481
--form " path=impapi" \
482
482
--form " file=@/path/to/somefile.txt"
0 commit comments