General API Information

The Seven Corners API is a RESTful service which provides methods for accessing specific resources at canonical URLs and for searching and filtering sets of resources by various criteria. All representations are encoded as JSON objects.

Service Endpoint

The Seven Corners API’s base endpoint is https://api.sevencorners.com/.

Resources

You can access six resource types using the API:

  • Agent: Retrieve agent details for a specific policy.
  • Fulfillment: Id cards, fulfillment documents, and policy documentation.
  • Quote: Get individual and group quotes.
  • Products: Interact with the active products and policies sold by Seven Corners.
  • Purchasing: Purchase Seven Corners products.

Authentication

All requests to the APIs must be authenticated using the methods outlined in the request signing and authentication guidelines. Requests which fail authentication generally pass a 401 HTTP code and an error describing the reason for rejection.

Machine-Readable Documentation

All API endpoints are documented as machine-readable representations using the swagger-doc specification. These representations are available at http://www.sevencorners.com/developer/api-documentation2.

Some odds and ends with requests

HTTP Verbs

Endpoints can accept GET and POST requests. Which endpoints accept which verbs is defined on the API documentation page.

ETags

Most successful results will contain an “etag” attribute and ETag HTTP header with a digest of the returned content. In order to save bandwidth and make your application more performant, you may optionally pass an “if-none-match” HTTP header with that digest for subsequent requests to the same URL. If the content has not changed since the last request, the response code will return with an empty body and a 304/Not Modified HTTP header and you can use a previously-stored value for the content.

Note: Most browsers will do this automatically, but you may need to manually add this logic to server-side applications.

For example:

Initial request:

Request Url: https://api.sevencorners.com/api/v1/agent/7833
                            		Request Method: GET
                            		Params: {
                            		    "policyId": "7833"
                            		}
                            		Headers: {
                            		  Accept: */*
                            		}

 

Initial response:

Status Code: 200
  {
      "content-length": "491",
  "content-type": "application/json; charset=utf-8",
  "server": "Microsoft-IIS/8.5",
  "x-powered-by": "ASP.NET",
  "date": "Tue, 21 Feb 2017 18:48:39 GMT",
  "": ""
}

 

Cross-origin requests and JSONP

Responses generated by the Seven Corners API are compliant with the W3C CORS specification, which allows any properly-authorized requests to be made from any origin domain. This means that you should not need to wrap calls in JSONP callbacks in order to make calls from browser-based applications. If you do prefer to use JSONP, however, all endpoints will accept a callback parameter to all endpoints that will wrap results in a JSONP wrapper.

Examples

Without a callback:

Request: GET https://api.sevencorners.com/token?apikey=yourAPIKEY
                            		Response: 
                            		{
                            		    "code": 200,
                            		    "status": "Ok",
                            		    "etag": "f0fbae65eb2f8f28bdeea0a29be8749a4e67acb3",
                            		    "data": {
                            		 	  … [other data points]
                            		}

 

With a callback

Request: GET https://api.sevencorners.com/token?apikey=yourAPIKEY&callback=callback_param
                            		Response: 
                            		callback_param({
                            		    "code": 200,
                            		    "status": "Ok",
                            		    "etag": "f0fbae65eb2f8f28bdeea0a29be8749a4e67acb3",
                            		    "data": {
                            		    … [other data points]
                            		})

 

GZIP Compression

In order to save bandwidth and make your application more performant, the Seven Corners API can compress responses with GZIP. You may request a GZIP-ed response by passing an Accept-Encoding header to any endpoint.

Example:

Request:

Request Url: https://api.sevencorners.com/api/v1/agent/7833
                            Request Method: GET
                            Params: {
                                "policyId": "7833"
                            } Headers: { Accept-Encoding:gzip }

 

Response:

Status Code: 200
  {
       "content-length": "491",
       "content-type": "application/json; charset=utf-8",
"Content-Encoding": "gzip",
       "server": "Microsoft-IIS/8.5",
       "x-powered-by": "ASP.NET",
       "date": "Tue, 21 Feb 2017 18:48:39 GMT",
       "": ""
  }

Documents

Privacy Information
Terms of Use
Security Statement

Connect with Seven Corners

About Us
Newsroom
Careers

   

Contact Us