Files
Yassine Guedidi efa2dd0d17 Add 'doc/' from commit '04f0bd51cc8886658dfcd3cda88c0948953b322f'
The documentation was imported from the former wallabag/doc repository.

We imported the documentation with:

  git subtree add --prefix=doc <path-or-url-to-wallabag/doc> master

A one-pass equivalent cleanup for imported commit messages was then:

  python3 git-filter-repo \
    --message-callback 'return re.sub(br"(?<![/\w])#(\d{1,3})(?!\d)", br"https://github.com/wallabag/doc/pull/\1", message)' \
    --refs master..chore/merge-doc-into-monorepo \
    --force

The rewrite approach was inspired by https://web.archive.org/web/20241208191856/https://aaronhe.org/git-filter-repo-to-rewrite-commit-history.

git-subtree-dir: doc
git-subtree-mainline: 6c48d72c64
git-subtree-split: 04f0bd51cc
2026-03-21 00:10:47 +01:00

186 lines
19 KiB
Markdown

---
title: Methods
weight: 2
---
## Getting existing entries
Documentation for this method:
https://app.wallabag.it/api/doc#get--api-entries.{_format}
As we work on a fresh wallabag installation, we'll have no result with this command:
```bash
http GET http://localhost:8000/api/entries.json \
"Authorization:Bearer ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
```
returns:
```http
HTTP/1.1 200 OK
0: application/json
Cache-Control: no-cache
Connection: close
Content-Type: application/json
Date: Tue, 05 Apr 2016 08:51:32 GMT
Host: localhost:8000
Set-Cookie: PHPSESSID=nrogm748md610ovhu6j70c3q63; path=/; HttpOnly
X-Debug-Token: 4fbbc4
X-Debug-Token-Link: /_profiler/4fbbc4
X-Powered-By: PHP/7.0.4
```
The `items` array is empty.
cURL example:
```bash
curl --get "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
```
## Adding your first entry
Documentation for this method: https://app.wallabag.it/api/doc#post--api-entries.{_format}
```bash
http POST http://localhost:8000/api/entries.json \
"Authorization:Bearer ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA" \
url="http://www.numerama.com/tech/160115-le-pocket-libre-wallabag-fait-le-plein-de-fonctionnalites.html"
```
returns
```http
HTTP/1.1 200 OK
0: application/json
Cache-Control: no-cache
Connection: close
Content-Type: application/json
Date: Tue, 05 Apr 2016 09:07:54 GMT
Host: localhost:8000
Set-Cookie: PHPSESSID=bjie40ck72kp2pst3i71gf43a4; path=/; HttpOnly
X-Debug-Token: e01c51
X-Debug-Token-Link: /_profiler/e01c51
X-Powered-By: PHP/7.0.4
```
Now, if you execute the previous command (see **Get existing entries**), you'll have data.
cURL example:
```bash
curl "https://localhost:8000/api/entries.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA&url=http://www.numerama.com/tech/160115-le-pocket-libre-wallabag-fait-le-plein-de-fonctionnalites.html"
```
## Deleting an entry
Documentation for this method: https://app.wallabag.it/api/doc#delete--api-entries-{entry}.{_format}
```bash
http DELETE http://localhost:8000/api/entries/1.json \
"Authorization:Bearer ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
```
returns
```http
HTTP/1.1 200 OK
0: application/json
Cache-Control: no-cache
Connection: close
Content-Type: application/json
Date: Tue, 05 Apr 2016 09:19:07 GMT
Host: localhost:8000
Set-Cookie: PHPSESSID=jopgnfvmuc9a62b27sqm6iulr6; path=/; HttpOnly
X-Debug-Token: 887cef
X-Debug-Token-Link: /_profiler/887cef
X-Powered-By: PHP/7.0.4
```
And if you want to list the existing entries (see **Get existing entries**), the array is empty.
cURL example:
```bash
curl --request DELETE "https://localhost:8000/api/entries/1.html?access_token=ZGJmNTA2MDdmYTdmNWFiZjcxOWY3MWYyYzkyZDdlNWIzOTU4NWY3NTU1MDFjOTdhMTk2MGI3YjY1ZmI2NzM5MA"
```
## Other methods
We didn't write examples for each API method.
Have a look on the listing here: https://app.wallabag.it/api/doc to learn about each method.