The Cloverpop Decisions Integration App allows you to make requests to the Cloverpop server and create decisions.
The Cloverpop Decisions Integration App is built on:
- Ruby 3.1.2
- Rails 7.1.3
- postgresql 10.0 or higher
- Setup
- Methods
- Usage
- Error Handling
- Security
- New Development Machine Install (Mac)
- GIT and Changing Code
- License
Before using the PagesController
, make sure you have the following environment variables set:
CLOVERPOP_DOMAIN
: The base URL of the Cloverpop API.CLOVERPOP_ORG_API_TOKEN
: Your organization's API token for authentication.
- Description: Initiates data retrieval from the Cloverpop API.
- HTTP Method: GET
- Endpoint:
CLOVERPOP_DOMAIN/api/v1/decisions
- Description: Creates a new decision via the Cloverpop API.
- HTTP Method: POST
- Endpoint:
CLOVERPOP_DOMAIN/api/v1/decisions
- Parameters:
decision
: The decision to be created, passed as a parameter.
- Description: Makes a generic API request to the specified URL using the provided HTTP method.
- Parameters:
url
: The URL of the API endpoint.method
: The HTTP method (:get
,:post
, etc.).body
: Optional. The request body in JSON format.
To utilize the methods provided by the PagesController
, follow these steps:
- Ensure the required environment variables are correctly set in your application environment.
- Use the methods
init_data
andcreate_decision
as needed within your application logic.
If an error occurs during an API request, the controller will log the error and return an appropriate JSON response with an error message.
Ensure that sensitive information such as API tokens (CLOVERPOP_ORG_API_TOKEN
) is handled securely and not exposed publicly.
NOTE: After installing something new, if something doesn't work like you expect, try quitting and restarting terminal.
[...instructions continue...]
[...instructions continue...]
The MIT License (MIT)
[...license content...]