Skip to content

Using 121 API Endpoints

Ruben edited this page Nov 7, 2024 · 6 revisions

1. Authentication

  • Login:
    • Before using the API endpoints, log in as an admin. This can be done using the POST/api/users/login endpoint with credentials from Bitwarden.

2. Execution Process

  1. Select the API Endpoint:
    • Click on the desired API endpoint.
  2. Try It Out:
    • Select the Try it out option.
  3. Input Data:
    • Enter the required data fields. You may use the default input in the request body as an example.
  4. Execute and Review:

3. HTTP Request Methods Used by 121 API Endpoints

  • GET: Retrieve data from a specified resource.
  • POST: Submit an entity to a specified resource, potentially altering the server's state.
  • PATCH: Apply partial modifications to a resource.
  • PUT: Replace all current representations of the target resource with the request payload.
  • DELETE: Remove the specified resource.

4. Highlighted 121 API Endpoints Used by Cash-IM

Important: To get the ID of the program, go to the program in the portal and check the URL, e.g., https://portal.demo.121.global/program/[id]/payment.

financial-service-providers
  • GET /api/financial-service-providers - Retrieve all Financial Service Providers.
financial-service-providers/intersolve-voucher
  • GET /api/programs/{programId}/financial-service-providers/intersolve-voucher/instructions - Get Intersolve voucher instructions image for use in WhatsApp messages via Twilio.
  • POST /api/programs/{programId}/financial-service-providers/intersolve-voucher/instructions - Upload Intersolve voucher instructions image.
instance
  • POST /api/scripts/reset - Reset the instance database. Details about seed scripts and other inputs to follow.
notifications
  • GET /api/notifications/{programId}/message-templates - Retrieve all message templates for a program.
  • POST /api/notifications/{programId}/message-templates - Create a message template.
  • DELETE /api/notifications/{programId}/message-templates/{type} - Delete message template(s) by type and optionally by language.
  • PATCH /api/notifications/{programId}/message-templates/{type}/{language} - Update message template.
programs
  • POST /api/programs - Create a new program. Details on Kobo creation to follow.
  • GET /api/programs/{programId} - Retrieve program details by ID.
  • DELETE /api/programs/{programId} - Delete a program and all related data.
  • PATCH /api/programs/{programId} - Update program details.
  • GET /api/programs/{programId}/fsp-configuration - Retrieve all ProgramFspConfigurationEntity for a specific program.
  • POST /api/programs/{programId}/fsp-configuration - Create a ProgramFspConfigurationEntity for a program.
  • PUT /api/programs/{programId}/fsp-configuration/{programFspConfigurationId} - Update ProgramFspConfigurationEntity.
  • POST /api/programs/{programId}/program-questions - Create program questions.
  • PATCH /api/programs/{programId}/program-questions/{programQuestionId} - Update a program question.
  • DELETE /api/programs/{programId}/program-questions/{programQuestionId} - Delete a program question and associated answers.
programs/registrations
  • PATCH /api/programs/{programId}/registrations - Bulk update registrations via a CSV file.
roles
  • GET /api/roles - Retrieve all user roles.
  • POST /api/roles - Create a new user role.
  • PUT /api/roles/{userRoleId} - Update an existing user role.
  • DELETE /api/roles/{userRoleId} - Delete a user role.
users
  • GET /api/programs/{programId}/users/search - Search for a user based on their username.
  • POST /api/users - Register a new user.
  • DELETE /api/users/{userId} - Delete a user by their user ID.
  • POST /api/users/login - Log in an existing user.
  • PATCH /api/users/password - Reset a user password without needing the current password.

5. Tips

  • For PATCH endpoints, you do not need to fill all the fields in the body; you can provide input only for the fields you want to change.
  • Some FSPs can be configured per program using the FSP configuration (only Excel?). For more information on using the API endpoint with Excel, refer to the documentation here: Excel Payment Instructions FSP.

Home Page

Clone this wiki locally