-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
123 lines (87 loc) · 2.71 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
FORMAT: 1A
HOST: http://polls.apiblueprint.org/
# BN
Webscrapper API
## Jobs Collection [/api/1.0/jobs]
### Get All Jobs [GET]
+ Response 200 (application/json)
[
{
"id": "1",
"frn": 2,
"status": "ONGOING",
"percentageComplete": 45,
"dateTimeStarted": "2018-03-15T15:25:19+00:00",
"dateTimeCompleted": null
},
{
"id": "1",
"frn": 2,
"status": "COMPLETED",
"percentageComplete": 100,
"dateTimeStarted": "2018-03-15T15:25:19+00:00",
"dateTimeCompleted": "2018-04-15T15:25:19+00:00"
}
]
### Process a job [POST]
+ Request (application/json)
[
{
"frn": 1,
"maxLevel": 1,
"url": "https://app.apiary.io/bn4/editor",
"linksPerLevel":10
},
{
"frn": 2,
"maxLevel": 1,
"url": "https://app.apiary.io/bn4/editor",
"linksPerLevel":10
}
]
+ Response 201 (application/json)
+ Headers
Location: /api/jobs
+ Body
[
{
"id": "1",
"frn": 2,
"status": "ONGOING",
"percentageComplete": 45,
"dateTimeStarted": "2018-03-15T15:25:19+00:00",
"dateTimeCompleted": null
},
{
"id": "1",
"frn": 2,
"status": "COMPLETED",
"percentageComplete": 100,
"dateTimeStarted": "2018-03-15T15:25:19+00:00",
"dateTimeCompleted": "2018-04-15T15:25:19+00:00"
}
]
### Fetch a single Job [GET /api/jobs/{id}]
+ Parameters
+ id (string) - Job ID
+ Response 200 (application/json)
{
"id": "1",
"frn": 2,
"status": "ONGOING",
"percentageComplete": 45,
"dateTimeStarted": "2018-03-15T15:25:19+00:00",
"dateTimeCompleted": null
}
### Jobs status [GET /api/jobs/report]
+ Response 200 (application/json)
{
"percentCompleted": "27.48",
"totalCanceled": 0,
"totalCompleted": 1,
"totalJobs": 4,
"totalOngoing": 1
}
### Cancel All Ongoing Jobs [GET /api/jobs/stop-all]
+ Response 200 (application/json)
Jobs Cancellation Initiated...