You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this tutorial, we will be using the /latest endpoint to get the latest
8
-
circular in a category.
9
+
In this tutorial, we will be using the `/latest` endpoint to get the latest circular in a category.
9
10
10
-
This endpoint returns a dictionary (for `receive` being `all`) or string (for `receive` being `titles`/`links`), containing the latest circular (of the given category)'s title and direct download URL.
11
+
This endpoint returns a JSON object containing the latest circular's information.
11
12
12
13
:::tip Tip!
13
14
@@ -17,62 +18,108 @@ Use the `/cached-latest` endpoint if you're making an app that does not require
17
18
18
19
#### Parameters:
19
20
*`category` : `string`. Can have values (`general`, `ptm`, `exam`) [Mandatory]
20
-
*`receive` : `string`. Can have values (`all`, `titles`, `links`) [Optional]
21
21
22
22
The `category` parameter refers to one of the 3 main category of circulars on the
23
23
BPS Website.
24
24
25
-
The `receive` parameter refers to what data you want to receive, either `all` which gives
26
-
the latest circular's Name and download URL, or `titles` which gives only the latest circular's Name, or `links` which gives only the latest circular's download URL.
27
25
28
26
## Example Requests
29
27
30
-
Python
31
28
32
29
30
+
<Tabs>
31
+
<TabItemvalue="python"label="Python"default>
32
+
33
+
Here is an example request using Python's `requests` library:
34
+
33
35
```python
34
36
import requests
35
37
36
-
url ="https://bpsapi.rajtech.me/v1/latest/"
37
-
payload = {'category': 'ptm', "receive": "all"}
38
+
url ="https://bpsapi.rajtech.me/v1/latest"
39
+
payload = {'category': 'ptm'}
38
40
39
41
request = requests.get(url, json=payload)
40
42
print(request.text)
41
43
```
42
44
43
-
Curl
45
+
</TabItem>
46
+
<TabItemvalue="curl"label="cURL">
47
+
48
+
Here is an example request using cURL:
44
49
45
50
```bash
46
51
curl -X 'GET' \
47
-
'https://bpsapi.rajtech.me/v1/latest/' \
52
+
'https://bpsapi.rajtech.me/v1/latest' \
48
53
-H 'accept: application/json' \
49
54
-H 'Content-Type: application/json' \
50
55
-d '{
51
56
"category": "ptm",
52
-
"receive": "all"
53
57
}'
54
58
```
55
59
60
+
61
+
</TabItem>
62
+
63
+
</Tabs>
64
+
65
+
66
+
56
67
## Example Response
57
68
58
-
1. Category: `ptm`, Receive: `all`
69
+
<Tabs>
70
+
<TabItemvalue="general"label="General"default>
71
+
72
+
When getting circulars from the `general` category, the response is a dictionary with the following keys:
59
73
60
74
```python
61
-
{"title":"2nd Parent Teacher Meeting (PTM) for Grades IX, X & XII",
0 commit comments