Phu Quoc Dog
Search…
Feeds
To create a feed you have following the structer below:
Property Name
Type
Description
Default
Required
url
string
The source you want to add new feed
n/a
yes
tags
string
The tags name for this feed
n/a
no
name
string
The title you want to add new feed
n/a
no
isPrivate
int
Option for public or private that feed, default is public
0
no
For example to create a new feed:
1
// Some code
2
feed.json
3
{
4
"url" : "https://www.phuquoc.dog",
5
"tags" : "pqd,phuquocdog,polkadot",
6
"name": "Add demo create feed",
7
"isPrivate" : 0
8
}
9
curl "https://api.phuuqoc.dog/feeds" \
10
-X POST \
11
-H "Authorization: Bearer 1234567890" \
12
-H "Content-Type: application/json" \
13
-d @feed.json
Copied!
Result:
1
// Some code
2
{
3
"data": {
4
"id": 2986,
5
"url": "https://phuquoc.dog",
6
"thumb": {
7
"id": 4347,
8
"key": "feeds/b2c8f70b1c31707.png",
9
"privacy": "public-read",
10
"url": "https://cdn.phuquoc.dog/feeds/b2c8f70b1c31707.png",
11
"expires": 1571092182,
12
"originalFileName": "bf7e6f5d7d3ccbd202caca8161867c90.png",
13
"fileSize": 128730,
14
"cdn": "https://cdn.phuquoc.dog/feeds/b2c8f70b1c31707.png"
15
},
16
"name": "Add demo create feed",
17
"createdOn": "2021-11-09 15:34:55",
18
"updatedOn": null,
19
"thumbWidth": null,
20
"thumbHeight": null,
21
"tags": "pqd,phuquocdog,polkado",
22
"userFollowing": {
23
{
24
"id": 1,
25
"username": "phuquocdog"
26
}
27
}
28
}
29
}
Copied!
There are two-part to create feed this design like submitting an email form gmail:
  • One for upload context with format json
  • One for uploading media files with format multipart/form-data
First, you need to create metadata for the feed, Once the metadata is uploaded success you get a URL, which allows you to PUT. PUT is idempotent so you can retry failed uploads to your heart's content, replacing old attempts as you go.
Property Name
Type
Description
Default
Required
type
string
The type name for this feed
n/a
yes
tags
string
The tags name for this feed
n/a
no
name
string
The title you want to add new feed
n/a
no
isPrivate
int
Option for public or private that feed, default is public
0
no
For example to create a new feed:
1
// Some code
2
feed.json
3
{
4
"tags" : "pqd,phuquocdog",
5
"name": "Add demo create feed via upload file",
6
"isPrivate" : 0,
7
"type" : "upload"
8
}
9
curl "htps://api.phuuqoc.dog/feeds" \
10
-X POST \
11
-H "Authorization: Bearer 123456789" \
12
-H "Content-Type: application/json" \
13
-d @feed.json
Copied!
Result:
1
// Some code
2
{
3
"data": {
4
"id": 12,
5
"url": "upload",
6
"thumb": null,
7
"thumbBgcolor": null,
8
"name": "Add demo create feed via upload file",
9
"artistName": null,
10
"createdOn": "2021-11-09 06:08:59",
11
"updatedOn": null,
12
"tags": "pqd,phuquocdog",
13
"thumbWidth": null,
14
"thumbHeight": null,
15
"urlSource": null,
16
"userId": 662,
17
"deleted": null,
18
"userFollowing": [
19
{
20
"id": 1,
21
"username": "phuquocdog"
22
}
23
],
24
"isSaveFeed": true
25
}
26
}
Copied!
Then call api upload file, see docs at ./Uploads.md
1
curl "https://api.phuquoc.dog/uploads?type=image" \
2
-X POST \
3
-F '[email protected]/path/to/pictures/picture.jpg'
4
-H "Authorization: Bearer 123456789" \
5
-H "Content-Type: multipart/form-data"
Copied!
Result:
This result to use step create the feed above, in that case, we will be using id=34 to update again
1
{
2
"id": 34,
3
"key": "thumbnail/fc8eeee33b594503216eaa9.jpg",
4
"privacy": "public-read",
5
"url": "http://cdn.phuquoc.dog/thumbnail/fc8eeee33b594503216eaa9.jpg",
6
"expires": 1569683899,
7
"originalFileName": "E899D833--454F-B90C.jpg",
8
"fileSize": 305956
9
}
Copied!
Then mobile dev team uses that result update again into the metadata feed. Of course, the mobile dev team can upload files first, then use that result to create a metadata feed.
1
feed.json
2
{
3
"thumb" : "34",
4
"type: "upload"
5
}
6
curl "https://api.phuquoc.dog/feeds/12" \
7
-X PUT \
8
-H "Authorization: Bearer 123456789" \
9
-H "Content-Type: application/json" \
10
-d @feed.json
Copied!
HTTP Request: DELETE https://api.phuquoc.dog/feeds/{id}
This endpoint allows you to delete a resource.
Deleting a resource removes it from all relation table and rate schemes! This cannot be undone so be careful
Special Query Parameters
Parameter
Description
Example
id
The ID of the resource to delete
id=3
A successful delete will return like below:
1
// Some code
2
{
3
"success": {
4
"message": "Delete feed success",
5
"code": 202
6
}
7
}
Copied!
HTTP Request: PUT https://api.phuquoc.dog/feeds/{id}
1
// Some code
2
feed.json
3
{
4
"tags" : "filecoin,pqd,ips",
5
"name": "Add demo update feed",
6
"isPrivate" : 0
7
}
8
curl "https://api.phuquoc.dog/feeds/2986" \
9
-X POST \
10
-H "Authorization: Bearer 123456" \
11
-H "Content-Type: application/json" \
12
-d @feed.json
Copied!
The result:
1
// Some code
2
{
3
"data": {
4
"id": 2986,
5
"url": "https://phuquoc.dog",
6
"thumb": {
7
"id": 4347,
8
"key": "feeds/b2c8f70b1c31707.png",
9
"privacy": "public-read",
10
"url": "https://cdn.phuquoc.dog/feeds/b2c8f70b1c31707.png",
11
"expires": 1571092182,
12
"originalFileName": "bf7e6f5d7d3ccbd202caca8161867c90.png",
13
"fileSize": 128730,
14
"cdn": "https://cdn.phuquoc.dog/feeds/b2c8f70b1c31707.png"
15
},
16
"name": "Add demo update feed,
17
"createdOn": "2021-11-09 15:34:55",
18
"updatedOn": null,
19
"thumbWidth": null,
20
"thumbHeight": null,
21
"tags": "filecoin,pqd,ips",
22
"userFollowing": {
23
{
24
"id": 1,
25
"username": "phuquocdog"
26
}
27
}
28
}
29
}
30
Copied!
That feature like retweet on twitter.com
HTTP Request: POST https://api.phuquoc.dog/feeds/refeed
Property Name
Type
Description
Default
Required
urlId
int
The url id you want to save feed
n/a
yes
isPrivate
int
Option for public or private that feed, default is public
0
no
For example, to re-feed with url id = 17 and status is public, the json will be like that.
1
// Some code
2
feed.json
3
{
4
"urlId" : "17",
5
"isPrivate" : 0
6
}
7
curl "https://api.phuquoc.dog/feeds/refeed" \
8
-X POST \
9
-H "Authorization: Bearer 123456" \
10
-H "Content-Type: application/json" \
Copied!

This endpoint retrieves all favorite feeds from the current user. The results returned are paginated.
HTTP Request: GET https://api.phuquoc.dog/feeds/favorite
Special Query Parameters
Parameter
Default
Description
Example
page
false
Return results pertaining to that page
page=3
fields
false
Allows you to return only attributes that you require
fields=artworkId,createdOn,name
limit
10
The number of results returned per page
limit=50
Sample request:
1
curl -H "Content-Type: application/json" -X GET ${HOST}/feeds/favorite?limit=2&page=1
Copied!
Sample response:
1
{
2
"data": [
3
{
4
"id": 5360,
5
"url": "http://vsco.co/media/593219df38ad40689e59b8bf?share=MTQ5NjQ1NTY2MA%3D%3D&display_rotate=enable",
6
"thumb": {
7
"id": 7201,
8
"key": "feedthumbnail/1234444.png",
9
"privacy": "public-read",
10
"url": "https://cdn.phuquoc.dog/feedthumbnail/eedthumbnail/1234444.png",
11
"expires": 1496488111,
12
"originalFileName": "PNG.PNG",
13
"fileSize": 811830,
14
"cdn": "https://cdn.phuquoc.dog/feedthumbnail/eedthumbnail/1234444.png"
15
},
16
"name": "VSCO - morld",
17
"tags": "",
18
"thumbWidth": 600,
19
"thumbHeight": 450,
20
"createdOn": "2021-10-03 11:08:31",
21
"updatedOn": null,
22
"isPrivate": 0,
23
"userFollowing": [
24
{
25
"id": 6,
26
"username": "pqd"
27
}
28
]
29
},
30
{
31
"id": 3043,
32
"url": "http://fast.com",
33
"thumb": {
34
"id": 4441,
35
"key": "feedthumbnail/2de14aa4c3eb6f2a7d497efcf0ae4296.PNG",
36
"privacy": "public-read",
37
"url": "https://cdn.phuquoc.dog/feedthumbnail/2de14aa4c3eb6f2a7d497efcf0ae4296.PNG",
38
"expires": 1484374814,
39
"originalFileName": "PNG.PNG",
40
"fileSize": 811830,
41
"cdn": "https://cdn.phuquoc.dog/feedthumbnail/2de14aa4c3eb6f2a7d497efcf0ae4296.PNG"
42
},
43
"name": "Internet Speed Test | Fast.com",
44
"tags": "",
45
"thumbWidth": 600,
46
"thumbHeight": 450,
47
"createdOn": "2017-01-14 06:20:12",
48
"updatedOn": null,
49
"isPrivate": 1,
50
"userFollowing": [
51
{
52
"id": 888,
53
"username": "Tim002"
54
},
55
{
56
"id": 6,
57
"username": "pqd"
58
}
59
]
60
}
61
],
62
"meta": {
63
"pagination": {
64
"total": 37,
65
"count": 19,
66
"per_page": 2,
67
"current_page": 5,
68
"total_pages": 19,
69
"links": {
70
"previous": 4,
71
"next": 6
72
}
73
}
74
}
75
}
Copied!