API Flyer

Introduction

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).

Accepted POST Content types:

Data may be posted with the HTTP Content-Type as one of the following
  • application/x-www-form-urlencoded
  • multipart/form-data
  • application/json

Document Formatting Notes

Parameters

Standard syntax for specifying parameters is as follows:
Parameter Name Parameter Type POST | GET Comments/Restrictions Sample Value(s)
Parameter Key
* 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
Participant Status Keys
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.
back to top

Authentication

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 Parameters
user* string POST API user name yourname@yourcompany.com
key* string POST API key a0c3ku89v12d0mn35c
back to top

Response Format (JSON)

All 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.

back to top

Example PHP w/ CURL

	$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";
back to top

Example PHP w/ CURL sending as JSON

	$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.

GET Parameters
id* int GET Plan ID Number 39
Example Response https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findPlan/id/2
	[{
		"id":"2",
		"title":"Amerex - IHI",
		"deductible":"100",
		"policy_max":"100000",
		"er_fee":"0",
		"policy_number":"8341537-2090",
		"underwriter_id":"1",
		"status_id":"2",
		"has_id_card":"1",
		"card_url":"",
		"card_username":"",
		"card_password":"",
		"id_card_url":"",
		"price":"0.00",
		"medical_expenses":"-1",
		"emergency_medical_evacuation":"0",
		"emergency_reunion":"0",
		"repatriation":"0",
		"trip_interuption":"0",
		"card_template":"A",
		"deductible_type":"0"
	}]

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.

GET Parameters
id* int GET Plan ID Number 83
Example Response https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findPlanParticipants/id/83
	[{
		"id":"82836",
		"first_name":"John",
		"middle_name":"Q",
		"last_name":"Public",
		"address1":"123 Main Street",
		"address2":"",
		"city":"Big City",
		"state_id":"126",
		"country_id":"254",
		"home_country_id":"254",
		"zip":"12345",
		"dob":"1977-10-12",
		"tele":"",
		"email":"test@example.com",
		"gender":"M",
		"plan_id":"83",
		"status_id":"0",
		"status":"Inactive"
		"note":"",
		"secondaryEmail":null
		,"trip_can":"0",
		"start_date":"2011-10-31",
		"end_date":"2011-12-31",
		"courtesy_date":"2012-02-01",
		"created_date":"2011-10-12 14:24:07",
		"updated_date":"2014-10-24 09:52:27",
		"internal_id":null,
		"travel_days":"62",
		"us_citizen":"0",
		"us_destination":"1",
		"sports_rider":"0"
	}, ...]

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.

GET Parameters
id* int GET Plan ID Number 83
year int GET The Year to filter results by. If provided without the month and day, the beginning of the year is assumed 2024
month int GET The month to filter results by. If provided without the year, the current year is assumed. If provided without a day, the beginning of the month is assumed. 04
day int GET The day of the month to filter results by 19
strict boolean GET If set, only records modified after their inception will be included in the result set true | 1
since string GET The date to filter results by. If supplied in the URL, this will populate the year/month/day GET parameters 2024/04/19
2024/04
2024
Example Query URLs https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83
https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83?strict=true
https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83/since/2018/03/10
https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83/since/2018/03
https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83/since/2018
https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83/since/2018?strict=true
Example Response https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findUpdatedParticipants/id/83
	[{
		"id":"82836",
		"status":"In-Active",
		"status_id":"0",
		"start_date":"2024-10-31",
		"end_date":"2024-12-31",
	}, ...]

Returns a collection of all known plans, available to the logged in user.

Example Response https://www.envisageglobalinsurance.com/admin/api/ApiPlan/findAllPlans
	[{
		"id":"2",
		"title":"Amerex - IHI",
		"deductible":"100",
		"policy_max":"100000",
		"er_fee":"0",
		"policy_number":"8341537-2090",
		"underwriter_id":"1",
		"status_id":"2",
		"has_id_card":"1",
		"card_url":"",
		"card_username":"",
		"card_password":"",
		"id_card_url":"",
		"price":"0.00",
		"medical_expenses":"-1",
		"emergency_medical_evacuation":"0",
		"emergency_reunion":"0",
		"repatriation":"0",
		"trip_interuption":"0",
		"card_template":"A",
		"deductible_type":"0"
	}, ...]

Returns a participant provided by a participant id.

GET Parameters
id* int GET Participant ID 1234
Example Response https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/findParticipant/id/1
	[{
		"first_name":"Fang",
		"middle_name":"",
		"last_name":"Ding",
		"dateOfBirth":"1987-03-07",
		"gender":"",
		"address1":"",
		"address2":null,
		"city":"",
		"state":null,
		"zip":"",
		"country":null,
		"homeCountry":null,
		"email":"dingding19870307@126.com",
		"phone":"",
		"plan_id":"2",
		"status_id":"0",
		"status":"In-Active",
		"sports_rider":"0",
		"start_Date":"2008-06-05",
		"end_date":"2008-09-01",
		"courtesy_date":"2009-01-10",
		"labels":""
	}]

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.

GET Parameters
id * int GET Participant ID (required on update) 1234
POST Parameters
first_name string POST Participant's First Name John
middle_name string POST Participant's Middle Name Quincy
last_name string POST Participant's Last Name Adams
address1 string POST First line of participant's address 1234 Main Street
address2 string POST Second line of participant's address Suite 102
city string POST Participant's city/town Anytown
state_id int POST State/Province ID (See geographic actions) 12
stateName string POST State/Province Name
This is an optional replacement for state_id which will look up the proper state/province ID on the back end.
Florida
country_id int POST Country ID (See geographic actions) 245
countryName string POST Country Name
This is an optional replacement for country_id which will look up the proper country ID on the back end.
France
zip string POST Postal Code / Zip Code 12345-5555
home_country_id int POST Home Country ID / Nationality ID (See geographic actions) 245
homeCountryName string POST Home Country Name / Nationality
This is an optional replacement for home_country_id which will look up the proper country ID on the back end.
France
dob string (YYYY-mm-dd) POST Participant's Date of Birth (YYYY-mm-dd) 2009-02-28
tele string POST Participant or Coordinator's Telephone Number 1-888-555-5555 or +1 (888) 555-5555
email string POST Participant or Coordinator's Email Address paxname@paxcompany.com
secondaryEmail string POST Participant or Coordinator's Alternate Email alternateEmail@paxcompany.com
gender string (M|F) POST Participant's Gender -- M for male, F for female M
gender_x_preferred string (Y|N) POST Whether the participant prefers to identify as Gender X - Y for yes, N for no N
us_citizen string (Y|N) POST Whether the participant is a US Citizen or not -- Y for yes, N for no Y
us_destination string (Y|N) POST Whether the participant is travelling to the US or not -- Y for yes, N for no N
sports_rider string (Y|N) POST Whether the participant has a sports rider on their policy or not -- Y for yes, N for no N
plan_id * int POST The Plan ID that this participant is enrolled in. 39
trip_can int (0|1) POST Whether the participant has trip cancellation (Not applicable for all plans) -- 1 for yes, 0 for no 0
start_date string (YYYY-mm-dd) POST Start date for the participant's plan 2011-01-31
end_date string (YYYY-mm-dd) POST End date for the participant's plan 2011-03-28
courtesy_date string (YYYY-mm-dd) POST A courtesy reminder date if you intend to extend coverage in the future 2012-03-28
labelList string POST Searchable labels pertaining to the participant as a comma separated list SubGrp1, CustomTag2
internal_id string POST Optional ID field to track participant ID's from plan administrator's system. AB0001234
underwriter_ext_id string POST An ID field assigned by the underwriter to the participant.
This field is not applicable to all plans.
C001234.02S
tax_id string POST The Tax ID number or SSN associated with the participant.
This field is not applicable to all plans.
123-45-6789
visaType int (1|2|3|4|5) POST The type of visa that the participant is travelling on.
F-1: 1
J-1: 2
R-1: 3
M-1: 4
Other: 5
This field is not applicable to all plans.
1
visaTypeName string (F-1|J-1|M-1|R-1|Other) POST The type of visa that the participant is travelling on.
This is an optional replacement for visaType which will look up the proper visa type ID on the back end. This field is not applicable to all plans.
F-1
gross_premium float POST The gross premium allocated for this participant.
This field is not applicable to all plans.
2.05
Example Post Data
	Participant['first_name']=John;
	Participant['last_name']=Adams;
Example Response

Add - https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/addParticipant

Update - https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/addParticipant/id/2

	[{
		"message":"Participant saved.",
		"id":123
	}]

Emails a participant's id card via the participant id.

Note: This action will e-mail the participant directly.

GET Parameters
id * int GET Participant ID 1234
Example Response https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/emailPDFParticipant/id/1
	[{
		"message":"Email sent successfully."
	}]

Emails a participant's visa pdf via the participant id.

Note: This action will e-mail the participant directly.

GET Parameters
id * int GET Participant ID 1234
Example Response https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/emailVisaPDFParticipant/id/1
	[{
		"message":"Email sent successfully."
	}]

Downloads a participant's id card via the participant id.

Note: This action will download the document directly.

GET Parameters
id * int GET Participant ID 1234
Example Response https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/downloadPDFParticipant/id/1

The return response will be the body of the document pdf file. This data can then be written to a file or stored in a blob field.

	$document = $this->_sendAPICall('ApiParticipant/downloadPDFParticipant/id/3');
	file_put_contents( 'pax-3-id-card.pdf', $document );
Please verify your document after receipt! Due to the nature of the desired response, this API call will not generate the traditional JSON response on success, only the document body.

Downloads a participant's visa pdf via the participant id.

Note: This action will download the document directly.

GET Parameters
id * int GET Participant ID 1234
Example Response https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/downloadVisaPDFParticipant/id/1

The return response will be the body of the document pdf file. This data can then be written to a file or stored in a blob field.

	$document = $this->_sendAPICall('ApiParticipant/downloadPDFParticipant/id/3');
	file_put_contents( 'pax-3-visa.pdf', $document );
Please verify your document after receipt! Due to the nature of the desired response, this API call will not generate the traditional JSON response on success, only the document body.

Cancels a participant based on a provided participant id.

GET Parameters
id * int GET Participant ID 1234
Example Response https://www.envisageglobalinsurance.com/admin/api/ApiParticipant/cancelParticipant/id/1
	[{
		"message":"Successfully cancelled participant."
	}]

Returns a collection of all state regions.

Example Response https://www.envisageglobalinsurance.com/admin/api/ApiGeographic/findAllStates
	[{
		"RegionID":"5399",
		"CountryID":"181",
		"Region":"Katsina",
		"Code":"KT",
		"ADM1Code":"NI24"
	} ...]

Returns a collection of all country regions.

Example Response https://www.envisageglobalinsurance.com/admin/api/ApiGeographic/findAllCountries
	[{
		"CountryId":"277",
		"Country":"Kosovo",
		"FIPS104":"KV",
		"ISO2":"KV",
		"ISO3":"KV",
		"ISON":"KV",
		"Internet":"KV",
		"Capital":"Pristina",
		"MapReference":"Middle East",
		"NationalitySingular":"Kosovo",
		"NationalityPlural":"Kosovos",
		"Currency":"Euro",
		"CurrencyCode":"EUR",
		"Population":"1804838",
		"Title":"Kosovo",
		"Comment":"ISO is not yet definitive for Kosovo"
	} ...]
back to top

Status Codes

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.
back to top

Change Log

Date Description
December 2022
ApiPlan::findPlanParticipants Fix

We 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 Update
ApiPlan::findAllPlans Update

Added the `plan.category` field to the list of attributes returned when querying for plan attributes.

December 2018
ApiParticipant::findParticipant Update

We 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 New

We 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.