mirror of
https://github.com/pinry/pinry.git
synced 2026-01-11 01:32:05 +01:00
Feature: Add doc for API support
This commit is contained in:
30
docs/src/api.md
Normal file
30
docs/src/api.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# API Support
|
||||
|
||||
Pinry support API accessing via token so that you could write your own client or import any pin format to your instance.
|
||||
|
||||
# Get Token
|
||||
Just go to `My -> Profile` page to get the token.
|
||||
|
||||

|
||||
|
||||
# Access API via Token
|
||||
|
||||
Here is an example for curl to access `user-profile` API:
|
||||
|
||||
curl -X GET http://192.168.1.101:8080/api/v2/profile/users/ -H 'Authorization: Token fa3b0ed2b8a87c81323688c288642288c9570aca'
|
||||
|
||||
You will get response like this:
|
||||
|
||||
[
|
||||
{
|
||||
"username": "winkidney",
|
||||
"token": "fa3b0ed2b8a87c81323688c288642288c9570aca",
|
||||
"email": "winkidney@gmail.com",
|
||||
"gravatar": "0d7161ac663cdb21108502cd4051149c",
|
||||
"resource_link": "http://localhost:8000/api/v2/profile/users/1/"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
# API reference
|
||||
Just use the interactive API interface by DRF or follow the file [api.js](https://github.com/pinry/pinry/blob/master/pinry-spa/src/components/api.js)
|
||||
BIN
docs/src/imgs/screenshots/token-access.png
Normal file
BIN
docs/src/imgs/screenshots/token-access.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 43 KiB |
@@ -19,6 +19,7 @@ nav:
|
||||
- Theories: 'theories.md'
|
||||
- Install with Docker: 'install-with-docker.md'
|
||||
- Development: 'development.md'
|
||||
- API support: 'api.md'
|
||||
- Plugin System: 'plugin-system.md'
|
||||
- Upgrade Guide: 'upgrade-guide.md'
|
||||
- Docs: 'docs.md'
|
||||
|
||||
Reference in New Issue
Block a user