Skip to content

Commit 58d6a90

Browse files
author
Celine Lewerentz
committed
Improve text
1 parent b4d4171 commit 58d6a90

File tree

17 files changed

+139
-155
lines changed

17 files changed

+139
-155
lines changed

docs/developer_guide/api_usage/dci_api.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ OpenSPP provides a RESTful API that adheres to the Digital Convergence Initiativ
1111

1212
## Process
1313

14-
### Authentication: Obtaining an Access Token
14+
### Authentication: Obtaining an access token
1515

1616
The DCI API is secured using OAuth 2.0 with the Client Credentials grant type. Before making any data requests, your application must obtain a bearer token.
1717

1818
- **Endpoint**: `/oauth2/client/token`
1919
- **Method**: `POST`
2020
- **Body**: `x-www-form-urlencoded` with `grant_type`, `client_id`, `client_secret`, `db_name`.
2121

22-
**Example: Get Access Token**
22+
**Example: Get access token**
2323

2424
```python
2525
import requests
@@ -46,7 +46,7 @@ access_token = token_data.get("access_token")
4646
print("Access Token obtained successfully.")
4747
```
4848

49-
### Searching the Registry
49+
### Searching the registry
5050

5151
Once authenticated, you can use the access token to perform a synchronous search on the registry.
5252

@@ -57,7 +57,7 @@ Once authenticated, you can use the access token to perform a synchronous search
5757
- `Content-Type`: `application/json`
5858
- **Body**: A JSON object conforming to the DCI `sync/search` request specification.
5959

60-
**Example: Search for an Individual**
60+
**Example: Search for an individual**
6161

6262
```python
6363
search_url = f"{url}/registry/sync/search"
@@ -121,7 +121,7 @@ else:
121121
```
122122

123123

124-
### Setup and Configuration
124+
### Setup and configuration
125125

126126
To use the DCI API, you must first configure a client in OpenSPP.
127127

@@ -131,13 +131,13 @@ To use the DCI API, you must first configure a client in OpenSPP.
131131
4. **Reveal Credentials**: A **Show** button will appear. Click it to reveal the `Client ID` and `Client Secret`.
132132
5. **Important**: Copy these credentials immediately. For security, the **Show** button will disappear after you close the dialog, and you will not be able to retrieve the secret again.
133133

134-
## Best Practices
134+
## Best practices
135135

136-
1. **Secure Credential Storage**: Never hard-code your `Client ID` or `Client Secret` in your application. Use environment variables or a secure secret management system.
137-
2. **Token Management**: Access tokens are short-lived. Your application should handle token expiration and automatically request a new one when needed.
138-
3. **Error Handling**: Implement robust error handling to manage different HTTP status codes and error responses from the API.
139-
4. **Secure Connections**: Always use HTTPS for all API traffic to protect data in transit.
140-
5. **Logging**: Log request `transaction_id`s and correlation IDs to help with troubleshooting and auditing.
136+
- **Secure Credential Storage**: Never hard-code your `Client ID` or `Client Secret` in your application. Use environment variables or a secure secret management system.
137+
- **Token Management**: Access tokens are short-lived. Your application should handle token expiration and automatically request a new one when needed.
138+
- **Error Handling**: Implement robust error handling to manage different HTTP status codes and error responses from the API.
139+
- **Secure Connections**: Always use HTTPS for all API traffic to protect data in transit.
140+
- **Logging**: Log request `transaction_id`s and correlation IDs to help with troubleshooting and auditing.
141141

142142
## References
143143

docs/developer_guide/api_usage/external_api_jsonrpc.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ OpenSPP exposes much of its data and functionality via JSON-RPC endpoints. You c
1717
**Endpoint:**
1818
- `/jsonrpc` — All JSON-RPC calls (authentication and model methods)
1919

20-
### JSON-RPC Payload Structure and Methods
20+
### JSON-RPC payload structure and methods
2121

2222
All interactions with the OpenSPP JSON-RPC API use a standard payload structure. Each request is a JSON object with the following keys:
2323

@@ -29,7 +29,7 @@ All interactions with the OpenSPP JSON-RPC API use a standard payload structure.
2929
- `args`: A list of arguments for the method.
3030
- `id`: A unique identifier for the request (integer or string).
3131

32-
**Example Payload:**
32+
**Example payload:**
3333
```python
3434
payload = {
3535
"jsonrpc": "2.0",
@@ -48,12 +48,12 @@ payload = {
4848
}
4949
```
5050

51-
**Common JSON-RPC Methods:**
51+
**Common JSON-RPC methods:**
5252
- `authenticate`: Used for logging in and obtaining a user ID.
5353
- `execute_kw`: Used for calling model methods (such as `create`, `write`, `unlink`, `search_read`).
5454
---
5555

56-
### Common Model Methods and Args
56+
### Common model methods and args
5757

5858
When using the `"object"` service with the `"execute_kw"` method, you can call various model methods. Here are the most common:
5959

@@ -121,7 +121,7 @@ Searches for records and reads their fields.
121121
["res.partner", "search_read", [[["is_group", "=", False]]], {"fields": ["name", "reg_id"], "limit": 5}]
122122
```
123123

124-
**Domain Filters:**
124+
**Domain filters:**
125125
A domain is a list of conditions, each as a list: `[field, operator, value]`.
126126
Example: `[["name", "=", "John Doe"]]`
127127

@@ -132,6 +132,7 @@ Example: `[["name", "=", "John Doe"]]`
132132

133133
**Result**
134134
Returns a dictionary of the search results.
135+
135136
---
136137

137138
### Authentication
@@ -163,9 +164,9 @@ if not uid:
163164
print("Authenticated UID:", uid)
164165
```
165166

166-
### Working with Individuals
167+
### Working with individuals
167168

168-
**Gather The Fields**
169+
**Gather the fields**
169170

170171
For this example we are going to use these fields:
171172

@@ -177,7 +178,7 @@ For this example we are going to use these fields:
177178
- `is_registrant` (boolean, default=True)
178179
- `is_group` (boolean, default=False)
179180

180-
**Example: Create an Individual**
181+
**Example: Create an individual**
181182

182183
```python
183184
# First, get a gender_id (e.g., for "Male")
@@ -247,9 +248,9 @@ updated = response["result"]
247248
print("Result:", updated)
248249
```
249250

250-
### Working with Groups
251+
### Working with groups
251252

252-
**Gather The Fields**
253+
**Gather the fields**
253254

254255
For this example we are going to use these fields:
255256

@@ -259,7 +260,7 @@ For this example we are going to use these fields:
259260
- `is_group` (boolean, default=True)
260261

261262

262-
**Example: Create a Group**
263+
**Example: Create a group**
263264

264265
```python
265266
# Get a group kind (e.g., "Household")
@@ -326,9 +327,9 @@ updated = response["result"]
326327
print("Result:", updated)
327328
```
328329

329-
### Working with Memberships
330+
### Working withmMemberships
330331

331-
**Gather The Fields**
332+
**Gather the fields**
332333

333334
From your `g2p_registry_membership` module, the main model is likely `g2p_registry_membership.group_membership`. Required fields typically include:
334335
- `individuak` (many2one, required)
@@ -337,7 +338,7 @@ From your `g2p_registry_membership` module, the main model is likely `g2p_regist
337338
- `start_date` (date, required)
338339
- Any other required fields as defined in your model
339340

340-
**Example: Add an Individual to a Group**
341+
**Example: Add an individual to a group**
341342

342343
```python
343344
# Get a membership kind (e.g., "Head")
@@ -384,19 +385,19 @@ membership_id = response["result"]
384385
print("Created Membership ID:", membership_id)
385386
```
386387

387-
### Security: Using API Keys
388+
### Security: Using API keys
388389

389390
- **API keys** are recommended over passwords for scripts and integrations.
390391
- Generate API keys in your OpenSPP user preferences under **Account Security**.
391392
- Use the API key in place of your password in all JSON-RPC calls.
392393

393-
## Best Practices
394+
## Best practices
394395

395-
1. **Use API Keys**: Safer than passwords; revoke if compromised.
396-
2. **Limit Permissions**: Create dedicated users for API access with only necessary rights.
397-
3. **Validate Responses**: Always check for errors or unexpected results.
398-
4. **Secure Connections**: Use HTTPS for all API traffic.
399-
5. **Log and Monitor**: Track API usage for auditing and troubleshooting.
396+
- **Use API Keys**: Safer than passwords; revoke if compromised.
397+
- **Limit Permissions**: Create dedicated users for API access with only necessary rights.
398+
- **Validate Responses**: Always check for errors or unexpected results.
399+
- **Secure Connections**: Use HTTPS for all API traffic.
400+
- **Log and Monitor**: Track API usage for auditing and troubleshooting.
400401

401402
## References
402403

docs/developer_guide/api_usage/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
# API Usage
33

4-
Welcome to the API Usage section of the OpenSPP Developer Guide. This section is your starting point for understanding and integrating with the various APIs that OpenSPP offers. Whether you are building new applications, automating business processes, or connecting external systems, these guides will help you make the most of OpenSPP’s extensible platform.
4+
This section is your starting point for understanding and integrating with the various APIs that OpenSPP offers. Whether you are building new applications, automating business processes, or connecting external systems, these guides will help you make the most of OpenSPP’s extensible platform.
55

6-
Here, you will find comprehensive documentation and practical examples for the following API types:
6+
Here, you can find documentation and practical examples for the following API types:
77

88
- {doc}`dci_api` Learn how to leverage the Digital Convergence Initiative (DCI) for robust data exchange and integration scenarios with other digital public infrastructure.
99
- {doc}`external_api_jsonrpc`: Explore the JSON-RPC interface for lightweight, remote procedure calls and automation.

docs/developer_guide/developer_mode.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
# Developer mode (debug mode)
55

6-
The developer mode (or debug mode) unlocks access to extra and advanced tools in OpenSPP. There are several ways to activate the developer mode: through the Settings or the URL.
6+
The developer mode (or debug mode) unlocks access to extra and advanced tools in OpenSPP. There are two ways to activate the developer mode; through the Settings or the URL.
77

88
## Activate through the settings
99

10-
To activate the debug mode, open the OpenSPP database settings, go to **Settings → General Settings → Developer Tools** and click **Activate the developer mode**. Make sure that you have installed at least one app to see the **Developer Tools** section in the **Settings** module.
10+
Open the OpenSPP database settings, go to **Settings → General Settings → Developer Tools** and click **Activate the developer mode**. Make sure that you have installed at least one app to see the **Developer Tools** section in the **Settings** module.
1111

1212
![Overview of the debug options under settings in Odoo.](developer_mode/1.png "Overview of the debug options under settings in Odoo.")
1313

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,92 @@
11

22
# Digital Convergence Initiative
33

4-
In the rapidly evolving landscape of digital public infrastructure (DPI), the principle of interoperability stands as an important for building efficient, inclusive, and sustainable systems in a country. This article delves into how OpenSPP implemented APIs outlined in the [DCI Interface Standards v1.0](https://standards.spdci.org/standards/standards-for-interoperability-interfaces/structure-and-versioning-of-the-standards) under Registry to enable interoperability with other systems such as CRVS.
4+
In the rapidly evolving landscape of digital public infrastructure (DPI), the principle of interoperability stands as an important corner stone for building efficient, inclusive, and sustainable systems. This article covers OpenSPP's implementation of APIs outlined in the [DCI Interface Standards v1.0](https://standards.spdci.org/standards/standards-for-interoperability-interfaces/structure-and-versioning-of-the-standards) which enables interoperability with other systems such as CRVS.
55

6-
The implementation can be categorized into two sections where OpenSPP operates as the client and OpenSPP operates as the server. Note that currently OpenSPP has only completed the sync implementation.
6+
The implementation allows OpenSPP to operate either as the client or as the server. Note that currently OpenSPP has only completed the sync implementation.
77

8-
## 1. Server Implementation
8+
## Server implementation
99

10-
This section focuses on utilizing OpenSPP as the source of truth for beneficiary information where OpenSPP acts as the server. Such integration allows OpenSPP to seamlessly interact with other critical systems by providing data, thereby enhancing data exchange and operational {term}`efficiency`. The following steps elaborate how the module can be configured.
10+
This section focuses on utilizing OpenSPP as the source of truth for beneficiary information by providing data, thereby enhancing data exchange and operational {term}`efficiency`. The following steps present the configuration of the module.
1111

12-
### 1.1 Deployment and Installation
12+
### Deployment and installation
1313

14-
1. Deploy [this branch](https://github.com/OpenSPP/openspp-api/tree/spp_dci_api_server) on a server
14+
1. Deploy [this branch](https://github.com/OpenSPP/openspp-api/tree/spp_dci_api_server) on a server.
1515

1616
2. Generate RSA Private and Public key.
1717

18-
3. Save the RSA private key to spp_dci_api_server/tools/private_key.pem.
18+
3. Save the RSA private key to spp_dci_api_server/tools/private_key.pem
1919

2020
4. Save the RSA public key to spp_dci_api_server/tools/public_key.pub
2121

22-
5. Login to OpenSPP, Go to Apps, Search “OpenSPP API: DCI Server” and Install.
22+
5. Login to OpenSPP and go to Apps. Search for “OpenSPP API: DCI Server” and install.
2323

24-
### 1.2 How to use
24+
### How to use
2525

26-
1. Login to OpenSPP
26+
1. Login to OpenSPP.
2727

28-
2. Navigate to Settings -> DCI API Client Credentials
28+
2. Navigate to Settings and click on DCI API Client Credentials.
2929

30-
3. Click Create button and fill-up the Client Name field then click Save.
30+
3. Click Create button. Fill in the Client Name field and then click Save.
3131

32-
4. “Show” button will appear.
32+
4. Click the “Show” button to reveal the Client ID and Client Secret.
3333

34-
5. Click the “Show” button to reveal the Client ID and Client Secret.
34+
5. Make sure to copy the Client ID and Client Secret.
3535

36-
6. Make sure to copy the Client ID and Client Secret.
36+
6. Upon closing the modal, “Show” button will not appear anymore and will not be able to reveal the Client ID and Client Secret.
3737

38-
7. Upon closing the modal, “Show” button will not appear anymore and will not be able to reveal the Client ID and Client Secret.
38+
7. Client ID and Client Secret will be used to retrieve Access Token.
3939

40-
8. Client ID and Client Secret will be used to retrieve Access Token.
40+
8. Access Token will be used to authenticate in the search Registry API.
4141

42-
9. Access Token will be used to authenticate in the search Registry API.
42+
9. To retrieve Access Token, Send a POST request to the url `<domain>/oauth2/client/token` with a body client_id, client_secret, and grant_type=’client_credentials’
4343

44-
10. To retrieve Access Token, Send a POST request to the url `<domain>/oauth2/client/token` with a body client_id, client_secret, and grant_type=’client_credentials’
44+
10. Copy the access_token in the response.
4545

46-
11. Copy the access_token in the response.
46+
11. To retrieve registry data, Send a POST request to the url `<domain>/registry/sync/search`.
4747

48-
12. To retrieve registry data, Send a POST request to the url `<domain>/registry/sync/search`.
48+
12. Header should have a key “Authorization” with a value “Bearer <access_token>”
4949

50-
13. Header should have a key “Authorization” with a value “Bearer <access_token>”
50+
13. Refer to the DCI API spec for the request and response structure.
5151

52-
14. Refer the DCI API spec for the request and response structure
52+
## Client implementation
5353

54-
## 2. Client Implementation
54+
This section focuses on utilizing another registry as the source for truth to get beneficiary information that can then be utilized in OpenSPP.
5555

56-
This section focuses on utilizing another registry as the source for truth to get beneficiary information. The following steps elaborate how the module can be configured to fetch data where OpenSPP acts as the client.
57-
58-
### 2.1 Deployment and Installation
56+
### Deployment and installation
5957

6058
1. Deploy these two branches([1](https://github.com/OpenSPP/openspp-api/tree/spp_crvs_import),[2](https://github.com/OpenSPP/openspp-base/tree/spp_data_source)) on a server
6159

62-
2. Get client_id and client_secret from CRVS(or from server).
60+
2. Get client_id and client_secret from CRVS (or from server).
6361

64-
3. Login to OpenSPP
62+
3. Login to OpenSPP.
6563

66-
4. Navigate to the Apps page, Search “OpenSPP Import: DCI API” and Install it.
64+
4. Navigate to the Apps page. Search for “OpenSPP Import: DCI API” and Install it.
6765

6866
5. Upon installing “OpenSPP Import: DCI API”, a data source is automatically created.
6967

70-
6. Navigate to Settings -> Data Source to view the created data source.
68+
6. Navigate to Settings and select Data Source to view the created data source.
7169

7270
7. Input the credentials in the client_id, client_secret, and grant_type field inside the Data Source record.
7371

74-
8. The only supported grant_type for now is “client_credentials”.
72+
NOTE: The only supported grant_type for now is “client_credentials”.
7573

76-
### 2.2 How to use
74+
### How to use
7775

78-
1. Navigate to Programs -> Import From Registry
76+
1. Navigate to Programs and select Import From Registry.
7977

80-
2. Create Search Criteria, Enter Search Criteria Name, Location, and Birthdate Range
78+
2. Create Search Criteria, Enter Search Criteria Name, Location, and Birthdate Range.
8179

8280
3. Click Fetch Button.
8381

8482
4. Individual records will be imported from OpenCRVS Lab to OpenSPP.
8583

86-
5. Fetch Button is now {term}`disabled` but it can be enabled by clicking the “Enable Fetching”.
84+
5. Fetch Button is now {term}`disabled` but can be enabled by clicking the “Enable Fetching”.
8785

88-
6. Once an individual record is already fetched, They are now created and visible to the Registry page.
86+
6. Once an individual record is fetched, it is created and visible to the Registry page.
8987

90-
7. Navigate to Registry -> Individual to check the individuals and Navigate to Registry -> Group to check the groups.
88+
7. Navigate to Registry and select Individual to check the individuals. Select Group to check the groups.
9189

92-
8. Refer the DCI API spec for the request and response structure
90+
8. Refer the DCI API spec for the request and response structure.
9391

9492
_NOTE: This documentation/implementation should be considered as an alpha release of the implementation of the DCI Interface Standards v1.0._

docs/developer_guide/integrations/esignet.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11

22
# eSignet Integration
33

4-
## Introduction
5-
6-
The integration of OpenSPP with eSignet aims to utilize [MOSIP eSignet](https://docs.mosip.io/1.2.0/integrations/e-signet) as the identity server for login into the OpenSPP platform. This provides a seamless user experience and enhances security by leveraging the OAuth protocol and allowing OpenSPP users to access the platform without the need for additional login credentials.
4+
The integration of OpenSPP with eSignet utilizes [MOSIP eSignet](https://docs.mosip.io/1.2.0/integrations/e-signet) as the identity server for login into the OpenSPP platform. This provides a seamless user experience and enhances security by leveraging the OAuth protocol and allowing OpenSPP users to access the platform without the need for additional login credentials.
75

86
## Prerequisites
97

108
To be able to start the integration, ensure the following:
119

1210
- The key exchange is completed as per the requirements of MOSIP.
1311
- Access to the eSignet account (Client ID) and Authorization URL, UserInfo URL, Token URL, and JWKS URL is received from MOSIP.
14-
- Need to have administrative privileges within OpenSPP to install modules.
15-
- The developer mode is activated in OpenSPP.
12+
- Administrative privileges within OpenSPP to install modules.
13+
- Developer mode is activated in OpenSPP.
1614

1715
## Objective
1816

docs/developer_guide/integrations/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Integrations
33

4-
This section provides comprehensive guides for connecting OpenSPP with external systems, identity providers, and other digital public infrastructure components. These integrations are key to building a robust and interoperable social protection ecosystem.
4+
This section provides guides for connecting OpenSPP with external systems, identity providers, and other digital public infrastructure components. These integrations are key to building a robust and interoperable social protection ecosystem.
55

66
In addition to the list to the ones listed below, we also have integration with OpenCRVS and OpenFN.
77

0 commit comments

Comments
 (0)