Skip to content

Commit 1c155b9

Browse files
authored
Merge pull request #9 from shaarli/get-link-docs
Get a single link API doc
2 parents 48c4571 + 523cbb6 commit 1c155b9

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

api-documentation.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,62 @@ $.ajax({
6868
}
6969
});
7070
```
71+
72+
## **GET link**
73+
74+
Retrieve a single link by its ID.
75+
76+
* **URL**: Endpoint discussion in #7.
77+
* **Method:** `GET`
78+
* **Path Parameters:**
79+
80+
**Required:**
81+
82+
* `[string]`
83+
Link ID.
84+
85+
* **URL Parameters:** none
86+
* **Body Parameters:** none
87+
88+
* **Success Response:** `200`
89+
**Content:**
90+
```json
91+
[
92+
{
93+
"id": "linkID",
94+
"url": "Shaared URL",
95+
"title": "link title",
96+
"description": "link description",
97+
"tags": [
98+
"shaarli",
99+
"php",
100+
"api"
101+
],
102+
"private": true,
103+
"created": "2016-06-15T19:23:14+0200",
104+
"updated": "not implemented yet"
105+
}
106+
]
107+
```
108+
**Notes**:
109+
* Dates use ISO8601 format.
110+
111+
* **Error Response:**
112+
- `401`: Invalid token/authentication.
113+
- `404`: Link not found
114+
Content:
115+
```json
116+
{ "message": "Link ID 'foobar' does not exist." }
117+
```
118+
* **Sample Call:**
119+
120+
```javascript
121+
$.ajax({
122+
url: "[See #7]/20160615_180000",
123+
type : "GET",
124+
success : function(r) {
125+
console.log(r);
126+
}
127+
});
128+
```
129+

0 commit comments

Comments
 (0)