Lorem Ipsum

REST Implementation

Our API uses REST Web Services to implement create, replace, update, and delete (CRUD) functions.

  • GET operations are used for inquiry requests.
  • The POST and DELETE verbs are not used or implemented by Imagine.
  • Unless otherwise specified, PUT operations are required for each service.
  • The REST Service expects all properties encoded as US ASCII Strings.

This web service uses the JSON (JavaScript Object Notation) method of encoding data for transmission via the HTTP network protocol. Most programming languages have libraries to convert an arbitrary object to and from a JSON data transfer encoding. Imagine provides a sample client application in the JAVA language implementing all functions described herein.



Connecting to the Server

The CardConnect REST Web Service base URL includes a protocol, host, port and servlet specification.



Testing Your Credentials

To test and validate site-level credentials, you can make a GET request with no body to the base URL. 

For example:

GET /api/v1/ HTTP/1.1
Host: <host>:<port>
Authorization: Basic {base64 encoded site-level credentials}

If the credentials are valid, the response returns the message “Imagine REST Servlet.” 

This represents an HTTPS request to the REST web service base URL. The servlet name is fixed within the application; the host and port are assigned by Imagine. 

A username and password are required in the HTTP Authorization Header property in each API request. You can use either the site-level or MID-level API credentials that you received from Imagine. 

Basic Authorization is expected, using a Base64-encoded username and password string as the value. If this value is incorrect or not provided in the request header, an HTTP Exception “401:Unauthorized” is returned to the caller




All required fields are used to evaluate for duplication of patient records.

PID: Numeric unique patient id from the electronic medical records system. Used for duplicate checking. REQUIRED.

ClientID: This is the id number of the clinic, in the case of multiple mutually shared clients. REQUIRED.

Firstname: Varcar(50) field. REQUIRED.

Lastname: Varcar(50) field. REQUIRED.

address1: Varcar(50) field.

address2: Varcar(50) field.

city: Varcar(50) field.

state: Varcar(50) field.

zip: Varcar(50) field.

email: Varcar(50) field.

phone: Varcar(50) field.

dob: Date of Birth. Varcar(50) field. REQUIRED.

Provider: Last name of the patient’s primary physician at the clinic. Varchar(50).

Location: Name or City of the Primary clinic the patient will be seen at.

Insurance: Name of the patients primary insurance company(If Any.)

Patient Response

Success: Patient was created with the data provided.

DUPLICATE UPDATED: Patient details were updated as being detected as a duplicate.

REJECTED: The patient was rejected.

             “PID”: “”,
              “clientID”: “”,
              “Firstname”: “”,
              “Lastname”: “”,
              “address1”: “”,
              “address2”: “”,
              “city”: “”,
              “state”: “”,
              “zip”: “”,
              “email”: “”,
              “phone”: “”,
              “DOB”: “”,