Summary

The Ingestion API is used as a means of sending Great American any type of document, including JSON, XML, PDF, etc.

Environment Base URLs
Environment External URL

DEV

https://dev01.api.gaig.com/ingestion

UAT

https://uat01.api.gaig.com/ingestion

PROD

https://prod01.api.gaig.com/ingestion

Authorization

All endpoints on this API are secured with OAuth 2.0, using the client_credentials grant type.

Environment External URL

DEV

https://dev01.api.gaig.com/oauth/token

UAT

https://uat01.api.gaig.com/oauth/token

PROD

https://prod01.api.gaig.com/oauth/token

Example HTTP Request
POST /oauth/token HTTP/1.1
Authorization: Basic {{base64 encoded clientId:clientSecret}}
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials
Example HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "api_product_list_json": [
    "issuance-dev",
    "rating-dev"
  ],
  "token_type": "Bearer",
  "access_token": "",
  "expires_in": 3599,
}
Authorization Response Fields
Field Type Description

api_product_list_json

array

Array of strings indicating the authorities granted to the client.

token_type

string

This value should be placed in the Authorization header for API requests.

Authorization: {{token_type}} {{access_token}}

access_token

string

This value should be placed in the Authorization header for API requests.

Authorization: {{token_type}} {{access_token}}

expires_in

number

The time in seconds when the access token will expire.

Endpoints

/api/dataTypes

Get the valid data types expected by the service to be used in the gaig-data-type header.

Example HTTP Request
POST /api/dataTypes HTTP/1.1
Authorization: Bearer {{access_token}}
Example HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "dataTypes": [
        "loss_run",
        "claims",
        "policy",
        "billing",
        "submission",
        "certificate"
  ]
}

/api/ingest

Send a document to be ingested. Headers and query parameters are stored as metadata about the document.

Example HTTP Request
POST /api/ingest HTTP/1.1
Authorization: Bearer {{access_token}}
Content-Type: application/json
gaig-data-type: policy

{
    "foo": "bar"
}
Example HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json

{
	"id": "1620324593515999999"
}

/api/ingestMultipart

Send a document to be ingested utilizing a multipart request. The part with name=metadata is stored as metadata about the document.

Example HTTP Request
POST /api/ingestMultipart HTTP/1.1
Content-Type: multipart/form-data; boundary=gc0p4Jq0M2Yt08jU534c0p

--gc0p4Jq0M2Yt08jU534c0p
Content-Disposition: form-data; name=metadata;
Content-Type: application/json

{
  "state": "OH"
}
--gc0p4Jq0M2Yt08jU534c0p
Content-Disposition: form-data; name=value; filename=123456;
Content-Type: application/json

{
 "foo": "bar"
}
--gc0p4Jq0M2Yt08jU534c0p--
Example HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json

{
"id": "1620324593515999999"
}

HTTP Status Codes

Successful Responses

200 - OK

The request has succeeded.

Note: Please refer to /api/docs for documentation regarding successful response bodies.

Client Errors

400 Bad Request

The server could not understand the request due to invalid syntax. Most 400 responses will contain the JSON structure in the example below. The field errors will contain an array of objects. Each object will have the fields: category, code and message. Some 400 responses may also contain additional JSON structure.

Example HTTP Response
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
    "errors": [
        {
            "category": "Invalid Request",
            "code": "INVALID",
            "message": "The request was missing some piece of data."
        }
    ]
}
400 Response Fields
Field Description

category

The category of the error.

code

This value is meant to be read by code, so that the consuming system can respond to a give error programmatically.

message

A human readable message describing the error.

401 - Unauthorized

Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.

Example HTTP Response
HTTP/1.1 401 Unauthorized
Content-Type: application/json

{
    "fault": {
        "faultstring": "Invalid Access Token",
        "detail": {
            "errorcode": "keymanagement.service.invalid_access_token"
        }
    }
}

403 - Forbidden

The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401, the client’s identity is known to the server.

404 - Not Found

The server can not find the requested resource. This means that the endpoint is not available on this API.

Server Errors

500 - Internal Server Error

The server has encountered a situation it doesn’t know how to handle.

Example HTTP Response
HTTP/1.1 500 Internal Server Error
Content-Type: application/json

{
    "timestamp": "2021-05-01T12:00:00.000-0400",
    "status": 500,
    "error": "Internal Server Error",
    "message": "Something went wrong. Please contact CustomerCare@GAIG.COM",
    "path": "/api/path"
}

501 - Not Implemented

The request method is not supported by the server and cannot be handled.

Note: This response may be returned if the endpoint is not relevant for the client. Please refer to /api/docs for the list of endpoints available for a client.

Example HTTP Response
HTTP/1.1 501 Not Implemented
Content-Type: application/json

{
    "timestamp": "2021-05-01T12:00:00.000-0400",
    "status": 501,
    "error": "Not Implemented",
    "message": "API not yet implemented.",
    "path": "/api/path"
}