Group APIs
OpenG2P Social Registry APIs are CRUD APIs that allow the end-user to create, read, and update the group registry data.
The Group APIs contain the following CRUD operations.
Create: Allows the creation of a new group entity.
Read: Enables the fetching of details about a group entity.
Update: Supports modifying existing group entities.
Delete API is not supported. Contact the Administrator to delete a group registrant.
The endpoints of Group APIs and their definitions are given below.
POST
/registry/group
This endpoint allows the end-user to create a new group.
GET
/registry/group/{_id}
This endpoint allows the end-user to retrieve the partner's information by a specific ID.
GET
/registry/group
This endpoint allows the end-user to search the group based on a specific ID or name.
The API request and response values used in the below sections are only an example for understanding. Do not use the example values in an API call.
Authentication
The Group APIs use a session-based authentication mechanism provided by Odoo. This involves initiating a session using login credentials. The end-user must authenticate by calling the /web/session/authenticate
endpoint with the appropriate parameters in the request body. Successfully authenticated sessions generate a session ID, which is then used to authenticate subsequent API requests.
Subsequent API requests must include the session ID in the header to maintain the authenticated session.
Session authentication endpoint
Method
GET
URL
<openg2p.sandbox.net>/web/session/authenticate
Body parameters
jsonrpc
The version of the JSON-RPC protocol
Mandatory
String
db
The name of the database
Mandatory
String
login
The user's login name
Mandatory
String
password
The user's password
Mandatory
String
Sample cURL request
Sample request
Create group registry
This endpoint allows the end-user to create a new group.
Key request parameters
Method
POST
URI
<openg2p.sandbox.net>/api/v1/registry/group
Cookie
session_id=<session_id>
Request body parameters
name
The name of a group
Mandatory
String
ids
It contains the list of ID details of a group
array
id_type
The type of the ID of a group
Mandatory
String
value
The value of the ID of a group
Mandatory
String
expiry_date
The date of expiry of a group registry
Mandatory
Date
Format: YYYY-MM-DD
registration_date
The date on which a group is registered
Optional
Date
Format: YYYY-MM-DD
phone_numbers
It contains the list of contact details of a group
array
phone_no
The contact number of a group
Mandatory
String
date_collected
The date on which a group data is collected
Optional
String
The email ID of a group
Optional
String
address
The address of a group
Optional
String
bank_ids
It contains the list of bank details of a group
array
bank_name
The bank name of a group
Optional
String
acc_number
The account number of a group
Optional
String
is_group
It defines whether the member belongs to group or not
Mandatory
Boolean
True
False
Note:
The default values is true.
members
It contains the details of a member belongs to a group
array
name
The name of a member
Mandatory
String
given_name
The given name of a member
Optional
String
addl_name
The additional name of a member
Optional
String
family_name
The family name of a member
Optional
String
ids
It contains the ID details of a member belongs to a group
array
id_type
The type of the ID of a member
Mandatory
String
value
The value of the ID of a member
Mandatory
String
expiry_date
The date of expiry of a member registry
Mandatory
Date
Format: YYYY-MM-DD
registration_date
The registration date of a member
Optional
Date
Format: YYYY-MM-DD
phone_numbers
It contains the contact details of a member
array
The email id of a member
Mandatory
address
The address of a member
Mandatory
gender
The gender of a member
Mandatory
String
birthdate
The date of birth of a member
Mandatory
Date
Format: YYYY-MM-DD
birth_place
The place of birth of a member
Mandatory
Date
Format: YYYY-MM-DD
is_group
It defines whether the member belongs to group or not
Optional
Boolean
True
False
Note:
The default values is true.
kind
It contains list of the name of the kind allocated to a member
array
name
The name of the kind allocated to a member
Mandatory
String
bank_ids
It contains the list of bank details of a member
array
bank_name
The bank name of a member
Optional
String
acc_number
The account number of a member
Optional
String
kind
It contains the name of the kind allocated to a group
Mandatory
is_partial_group
Mandatory
Sample cURL request
Sample request
Sample response
Successful response
Get group registry
This endpoint allows the end-user to retrieve the group registry data based on a specific ID.
Key request parameters
Method
GET
URI
<openg2p.sandbox.net>/api/v1/registry/group/{_id}
Cookie
session_id=<session_id>
id
The ID of a group
Mandatory
Number
Example: 124567
Sample cURL request
Sample response
Successful response
Search group registry
This endpoint allows the end-user to search the group based on a specific ID or name.
Key request parameters
Method
GET
URI
<openg2p.sandbox.net>/api/v1/registry/group/{_id}
(or)
<openg2p.sandbox.net>/api/v1/registry/group/{name}
Cookie
session_id=<session_id>
id
The ID of the individual
Optional
Number
Example: 4356789
name
The name of the individual
Optional
String
Example: John Miller
Sample cURL request
Sample response
<WIP>
API specification
The Group APIs are available in Stoplight at the following link.
Last updated