Skip to content

Commit a695998

Browse files
committed
updated use-search.md to match new api changes and minor fixes
1 parent db12279 commit a695998

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

docs/API/using-the-api/Use-cachedlatest.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ curl -X 'GET' \
5151
'https://bpsapi.rajtech.me/v1/cached-latest' \
5252
-H 'accept: application/json' \
5353
-H 'Content-Type: application/json' \
54-
-d '{
55-
"category": "ptm",
56-
}'
54+
-d '{"category": "ptm"}'
5755
```
5856

5957

docs/API/using-the-api/Use-latest.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ curl -X 'GET' \
5252
'https://bpsapi.rajtech.me/v1/latest' \
5353
-H 'accept: application/json' \
5454
-H 'Content-Type: application/json' \
55-
-d '{
56-
"category": "ptm",
57-
}'
55+
-d '{"category": "ptm"}'
5856
```
5957

6058

docs/API/using-the-api/Use-search.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
sidebar_position: 3
33
---
4+
import Tabs from "@theme/Tabs";
5+
import TabItem from "@theme/TabItem";
6+
47
# Using /search Endpoint
58

69
In this tutorial, we will be using the `/search` endpoint to get a circular's download URL and Title.
@@ -21,36 +24,52 @@ The `title` parameter refers to the circular name.
2124

2225
## Example Requests
2326

24-
Python
27+
<Tabs>
28+
<TabItem value="python" label="Python" default>
29+
30+
Here is an example request using Python's `requests` library:
2531

2632
```python
2733
import requests
2834

29-
url = "https://bpsapi.rajtech.me/v1/search/"
35+
url = "https://bpsapi.rajtech.me/v1/search"
3036
payload = {'title': 'mobile'}
3137

3238
request = requests.get(url, json=payload)
3339
print(request.text)
3440
```
3541

36-
Curl
42+
</TabItem>
43+
<TabItem value="curl" label="cURL">
44+
45+
Here is an example request using cURL:
3746

3847
```bash
3948
curl -X 'GET' \
40-
'https://bpsapi.rajtech.me/v1/search/' \
49+
'https://bpsapi.rajtech.me/v1/search' \
4150
-H 'accept: application/json' \
4251
-H 'Content-Type: application/json' \
4352
-d '{"title": "mobile"}'
4453
```
4554

46-
## Example Responses
55+
56+
</TabItem>
57+
</Tabs>
58+
59+
60+
61+
## Example Response
4762

4863

4964
```python
50-
[
51-
"Mobile Phone Usage Policy",
52-
"https://bpsdoha.com/circular/category/38-circular-ay-2022-23?download=1108:mobile-phone-usage-policy"
53-
]
65+
{
66+
"status": "success",
67+
"http_status": 200,
68+
"data": {
69+
"title": "Mobile Phone Usage Policy",
70+
"link": "https://bpsdoha.com/circular/category/38-circular-ay-2022-23?download=1108"
71+
}
72+
}
5473
```
5574
---
5675

0 commit comments

Comments
 (0)