diff options
Diffstat (limited to 'doc/api/README.md')
-rw-r--r-- | doc/api/README.md | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/doc/api/README.md b/doc/api/README.md index fd5e88cb9d5..d481d0699e7 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -194,13 +194,13 @@ You can use a [personal access token][pat] to authenticate with the API by passi Example of using the personal access token in a parameter: ```shell -curl https://gitlab.example.com/api/v4/projects?private_token=9koXpg98eAheJpvBs5tK +curl https://gitlab.example.com/api/v4/projects?private_token=<your_access_token> ``` Example of using the personal access token in a header: ```shell -curl --header "Private-Token: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects +curl --header "Private-Token: <your_access_token>" https://gitlab.example.com/api/v4/projects ``` 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, providing a username: ``` -GET /projects?private_token=9koXpg98eAheJpvBs5tK&sudo=username +GET /projects?private_token=<your_access_token>&sudo=username ``` ```shell -curl --header "Private-Token: 9koXpg98eAheJpvBs5tK" --header "Sudo: username" "https://gitlab.example.com/api/v4/projects" +curl --header "Private-Token: <your_access_token>" --header "Sudo: username" "https://gitlab.example.com/api/v4/projects" ``` Example of a valid API call and a request using cURL with sudo request, providing an ID: ``` -GET /projects?private_token=9koXpg98eAheJpvBs5tK&sudo=23 +GET /projects?private_token=<your_access_token>&sudo=23 ``` ```shell -curl --header "Private-Token: 9koXpg98eAheJpvBs5tK" --header "Sudo: 23" "https://gitlab.example.com/api/v4/projects" +curl --header "Private-Token: <your_access_token>" --header "Sudo: 23" "https://gitlab.example.com/api/v4/projects" ``` ## Status codes @@ -383,7 +383,7 @@ resources you can pass the following parameters: In the example below, we list 50 [namespaces](namespaces.md) per page. ```bash -curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/namespaces?per_page=50 +curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/namespaces?per_page=50 ``` ### Pagination Link header @@ -397,7 +397,7 @@ and we request the second page (`page=2`) of [comments](notes.md) of the issue with ID `8` which belongs to the project with ID `8`: ```bash -curl --head --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/8/issues/8/notes?per_page=3&page=2 +curl --head --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/8/issues/8/notes?per_page=3&page=2 ``` The response will then be: @@ -465,7 +465,7 @@ We can call the API with `array` and `hash` types parameters as shown below: `import_sources` is a parameter of type `array`: ```bash -curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \ +curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \ -d "import_sources[]=github" \ -d "import_sources[]=bitbucket" \ "https://gitlab.example.com/api/v4/some_endpoint @@ -476,7 +476,7 @@ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \ `override_params` is a parameter of type `hash`: ```bash -curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" \ +curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \ --form "namespace=email" \ --form "path=impapi" \ --form "file=@/path/to/somefile.txt" |