The Envisage Global Insurance API is provided as a means of automating the basic administrative tasks for a EGI Plan Administrator.
To use the Envisage Global Insurance API, you must have a valid EGI user account and be issued an API key by your account representative.
This API is primarily a RESTful one, but does require POST authentication for all requests. For that reason, we recommend building your requests via CURL, and have provided examples on how to do so. All responses are returned as JSON objects with success and status codes, in addition to the requested data (See example).
Parameter Name | Parameter Type | POST | GET | Comments/Restrictions | Sample Value(s) |
* | Parameter is required and may not be omitted. |
---|---|
* | Values which cannot be altered once added. These are parameters which are available on "Add" but not on "Update" |
† |
A GET parameter with a † symbol is only viable as a URL filter and cannot be submitted as part of a query string. For example, the following two URLs are synonymous and can be used interchangeably, since the action uses a GET parameter for the id: https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/findParticipant/id/4512 // OK! https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/findParticipant?id=4512 // OK!However, the following are NOT synonymous since the parameter is defined via a URL filter: https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83/since/2018/01/01 // OK! https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83?year=2018&month=01&day=01 // OK! https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83?since=2018/01/01 // NOT OK |
Label | Status ID | Description |
---|---|---|
In-Active | 0 | Participant coverage has not yet begun. |
Active | 0 | Participant is currently in the active window of coverage. |
Expired | 0 | Participant coverage has expired. |
Draft | 3 | Participant is in draft status - it is not currently valid for the plan with which it is associated. |
Flagged | 0 | Participant record has been flagged for review. |
Cancelled | 2 | Participant record has been cancelled as is no longer valid. |
Deleted | 1 | Participant record was deleted and is no longer valid or accessible. |
To use the Envisage Global Insurance API, you must have a valid EGI user account and be issued an API key. If you have any problems with your API key, or need to be issued a new one, please contact your account representative.
For security reasons, all requests will require your user name and API key to be provided as key-value pairs via POST (See example).
Request ParametersAll API responses will be returned as JSON in the following format with a statusCode, success indicator and a detailed response object which will vary per action.
{ statusCode:200, success:true, response: [{ first_name:John, middle_name:Q, last_name:Public, dateOfBirth:1988-09-29, gender:M, address1:123 Main Street, address2:null, city:Large City, state:Florida, zip:32230, country:United States, homeCountry:Italy, email:name@address.com, phone:555-555-5555, plan_id:2, status_id:2, sports_rider:0, start_Date:2011-11-23, end_date:2011-12-31, labels:"test,test2" }] }
In all of the action-specific examples below, the JSON described will be found in the "response"portion of the above object.
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/findParticipant/id/4512"); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); # Build the array of POST options - REQUIRES name and key $query = http_build_query(array( 'user' => 'yourname@yourcompany.com', 'key' => 'a0c3ku89v12d0mn35c', )); curl_setopt($ch, CURLOPT_POSTFIELDS, $query); $data = curl_exec($ch); curl_close($ch); print_r($data); echo "\n";
$data = [ 'user' => self::API_USER, 'key' => self::API_KEY, ]; $data_string = json_encode( $data ); $ch = curl_init("https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/findParticipant/id/4512"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'Content-Length: ' . strlen( $data_string ) ]); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); $result = curl_exec( $ch ); curl_close($ch);
Returns a particular plan based on the provided plan id.
Note: Will only work if the current user has access to the plan.
Returns all participants from a particular plan based on the provided plan id.
Note: Will only work if the current user has access to the plan.
Returns a list of participants which have been modified on the plan within the specified timeframe. The data returned is limited to the participant ID, start date, end date and current status. If no date is specified, the span will default to updates made in the last 24 hours.
Date ranges must be valid dates in the past, no further back than 2010. If you need older data, please contact your account representative directly.
Note: Will only work if the current user has access to the plan.
If no participants have been updated, an empty array will be returned.
Returns a collection of all known plans, available to the logged in user.
Returns a participant provided by a participant id.
Adds a new participant to the system, requires the post variable "participant" as an array with the documented POST parameters below.
Note: Adding a "id" GET parameter to this method will instead update the record.
Emails a participant's id card via the participant id.
Note: This action will e-mail the participant directly.
Emails a participant's visa pdf via the participant id.
Note: This action will e-mail the participant directly.
Downloads a participant's id card via the participant id.
Note: This action will download the document directly.
Downloads a participant's visa pdf via the participant id.
Note: This action will download the document directly.
Cancels a participant based on a provided participant id.
Returns a collection of all state regions.
Returns a collection of all country regions.
Code | Definition |
---|---|
200 | Request was successful. |
403 | Request unauthorized, please refer to the (Authentication) section for more details. |
404 | Could not locate the action, please ensure you are using a valid action from the list above. |
500 | An error occurred while processing the action. Please refer to the error message provided for more details. |
Date | Description |
---|---|
May 2024 |
ApiPlan::findUpdatedParticipants FixWhen no participants have been updated, the api will response with a success code and an empty data array, rather than a 500 response. |
December 2022 |
ApiPlan::findPlanParticipants FixWe have added the status label field to the list of properties returned via findPlanParticipants. It was documented as being included, but was not being returned in the list of properties. ApiPlan::findPlan UpdateApiPlan::findAllPlans UpdateAdded the `plan.category` field to the list of attributes returned when querying for plan attributes. |
December 2018 |
ApiParticipant::findParticipant UpdateWe have added the status and courtesy_date fields to the list of properties returned via findParticipant. Update the documentation to include the information on setting and retrieving the courtesy date field. |
July 2018 |
ApiPlan::findUpdatedParticipants NewWe have added the new findUpdatedParticipants method to the list of available plan specific actions. This option will allow you to pull the records for any participants added or updated within the last 24 hours on the specified plan. Optionally, you may specify an alternate beginning for the window of time. The data returned will be limited to the participant ID, start date, end date, status id and status label. If the 'strict' parameter is set, only those records which have been modified since their inception will be returned (i.e., excludes new records which have not been modified since their inception.) Minor documentation formatting updates. |