Integration Paths


Hosted Pages Integration

Hosted pages allow you to have an integration up and running in less than 10 minutes. Inflectus will handle the endpoint collection as well as display past webhook requests and their details. They also have the option to retry requests that have failed. This is the easiest way for you to integrate with Inflectus. There are currently not any customization options for these forms.

API Integration

The API integration will give you maximum amount of customization options when integrating with Inflectus. Although this path will take more time to complete the integration than the hosted pages, the development time should still be minimal and could be completed in 1-2 days of work. We provide all the API objects that you would need to bild in all the functionality that comes with our hosted pages.

Hosted Pages


Single Sign On

Inflectus allows you to use single sign on to redirect your users to a secure hosted page. You will need to turn on hosted pages by going to Admin->Hosted Options and enabling hosted pages in the Inflectus console. In that same page you will be able to find your public and private keys.
Required Parameters

hash: required
HMAC-SHA1 Hash using your private key along with a concatenated string of the timestamp, nonce, and customer_code
nonce: required
A unique number that can only be used once per successful single sign on
timestamp: required
A timestamp that must be +/- 1 hour of the request submission
customer_code: required
The customer you want to create the single sign on for. If the customer_code does not exist, a customer using that customer_code will be created
publickey: required
The public key that Identifies your account with Inflectus

Returns

If successful, should show the customer's hosted page

Call Definition
GET "https://app-inflectus.appspot.com/hosted/create/:customer_code?nonce=:nonce&hash=:hash&timestamp=:timestamp&publickey=:publickey"


https://app-inflectus.appspot.com/hosted/create/customer_1?nonce=1234&hash=501a12e0ab85af3e2e44139cfcad1f89f30cfdbd&timestamp=1234566789&publickey=yourpublickey"


Ruby Example
require 'openssl'
require 'base64'
require "net/https"
require "uri"
require "active_support/core_ext"

publickey = "yourpublickey"
privatekey = "yourprivatekey"
customer_code = "customer_1"
timestamp = Time.now.to_i
nonce = Base64.encode64(
      		OpenSSL::Random.random_bytes(32)
    	).gsub(/\W/, '').to_s
unsigned = timestamp.to_s << nonce << customer_code
hash = OpenSSL::HMAC.hexdigest(
	OpenSSL::Digest::Digest.new('SHA1'),
	privatekey,
	unsigned
	)
url = "https://app-inflectus.appspot.com/hosted/create/" << customer_code << "?publickey=" << publickey << "&nonce=" << nonce << "×tamp=" << timestamp.to_s << "&hash=" << hash
redirect url					
				

API


Introduction

Inflectus provides an API to integrate your product with Inflectus. The API is meant to be used by developers so if you do not have any coding experience, you would need assistance from an experienced developer.

Our API uses HTTPS as a communication protocol. We use HTTP verbs, HTTP errors, and HTTP authentication which can be consumed by any programming language. Currently, all responses are formatted in JSON so you would need a library that can convert data to and from JSON. All the examples we provide will be done with curl.

If you do not have an account, you can sign up for a free developer account.

Sign up with your Google account

Base URL

https://app-inflectus.appspot.com/v1/


Authentication

You can generate or re-generate your key in the Admin->Developer section in the UI. Inflectus uses basic autentication for all requests. The API Key is the username and the password field is ignored.

Example Request

curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" "https://app-inflectus.appspot.com/v1/events"

Do not forget to attach the ":" at the end of your API key to avoid errors.


Errors

Inflectus uses standard HTTP response codes to indicate the success or failure of each request. Generally all requests that return a response code between 200 and 299 should be considered successful. All responses between 400 and 499 should indicate an error with more information provided in the body of the request. Any codes 500 and above means that there was an error on our side. Feel free to contact us at support@inflectus.com if you run into any of these issues.

HTTP Status Codes
200 OK - Everything went great
201 Created - The record was successfully created
204 No Content - The request was successful but no content was returned
400 Bad Request - A malformed request
401 Unauthorized - The API key provided was not valid
404 Not Found - The URL provided does not match any resource objects
422 Invalid Content - Used when there is an issue with your payload
429 Over the limit - You have reached you maximum requst limit 500+ Error - Our bad!

General Error Format

Attributes

long_message:
This is a longer explanation of the error. This may include advice on how to solve the issue
code:
This is the HTTP status code
short_message:
This is the generic error message

Example General Error Response

{
  "long_message": "You have specified an incorrect username and password", 
  "code": 401, 
  "short_message": "Not Authorized"
}
				

Validation Error Format

This is the error that is produced when field validation fails. The format is the same as the general error response but the long message contains more details to the reason for the request failing. The Long message will contain a field name and value of an array of error messages.

Example Validation Error Response

{
  "long_message": {
    "customer_code": [
      "Customer code does not exist"
    ], 
    "event_code": [
      "Event code does not exist", 
      "Event is not active"
    ]
  }, 
  "code": 422,
  "short_message": "Unprocessable Entity"
}
				


Linking

Each object has a href property which is a fully qualified URL to that object. If a property is a JSON object, and only contains and href property, you can use that URL to obtain more information about the object. The property may also link to a collection of objects depending on the relationship between the object and the property.

Example

{
  "customer_code": "customer_1", 
  "name": "Customer 1", 
  "url": "https://test.com/myurl", 
  "created_at": "2013-05-25T11:53:44.906003", 
  "auth_pass": "[redacted]", 
  "auth": "none", 
  "last_update": "2013-05-25T11:53:44.906010", 
  "paused": false, 
  "href": "https://app-inflectus.appspot.com/v1/customers/customer_1", 
  "signature": null, 
  "auth_user": "", 
  "requests": {
    "href": "https://app-inflectus.appspot.com/v1/customers/customer_1/requests"
  }
				


Collections

Collections allow you to page through large result sets. You are provided a next, start and previous fully qualified URLs (or null if link does not exist) to help you navigate the collection as well as the total amount of records for your query. You can specify the amount of records per_page and what page you want. The collection will contain an items property that will contain all the results for the page you are on.


Optional Params
page: default is 1
The page number that you wish to fetch
per_page: default is 50, max is 200
How many records you want to fetch per page. Default of 50 and max of 200
Example

{
  "items": [
    {
      "customer_code": "customer_1", 
      "name": "Customer 1", 
      "url": "https://test.com/myurl", 
      "created_at": "2013-05-25T11:53:44.906003", 
      "auth_pass": "[redacted]", 
      "auth": "none", 
      "last_update": "2013-05-25T11:53:44.906010", 
      "paused": false, 
      "href": "https://app-inflectus.appspot.com/v1/customers", 
      "signature": null, 
      "auth_user": "", 
      "requests": {
        "href": "https://app-inflectus.appspot.com/v1/customers/customer_1/requests"
      }
    }
    ...more customers
  ], 
  "records": 255, 
  "prev": "https://app-inflectus.appspot.com/v1/customers?page=2&per_page=50", 
  "start": "https://app-inflectus.appspot.com/v1/customers?page=1&per_page=50", 
  "next": "https://app-inflectus.appspot.com/v1/customers?page=4&per_page=50"
}
				


Objects


Events

Events are actions that occur in your application. If you were a billing company, some events would be Successful Payment or Successful Refund. We recommend that you use events to allow your users to be notified in near real time when they happen.

Retrieve Event

Retrieve the specified event

Required Parameters

event_code: required
The code for the event

Returns

An Event object

Call Definition
GET "https://app-inflectus.appspot.com/v1/events/:event_code"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" "https://app-inflectus.appspot.com/v1/events/event_1"


Example Results
{
  "name": "Event 1", 
  "created_at": "2013-05-25T12:49:35.686703", 
  "retry_interval": 1, 
  "last_update": "2013-05-25T12:49:35.686713", 
  "max_retries": 10, 
  "href": "https://app-inflectus.appspot.com/v1/events", 
  "event_code": "event_1", 
  "example": "{\n    \"name\": \"name1\", \n    \"task\": \"taskid\", \n    \"user\": \"user1\"\n}", 
  "description": "This event is fired when a task is created."  "signature": false, 
  "active": true, 
  "requests": {
    "href": "https://app-inflectus.appspot.com/v1/events/event_1/requests"
  }
}
	
				



List Events

Returns a list of your events

Optional Parameters

page: default is 1
The page number that you wish to fetch
per_page: default is 50, max is 200
How many records you want to fetch per page. Default of 50 and max of 200

Returns

A collection of event objects.

Call Definition
GET "https://app-inflectus.appspot.com/v1/events"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" "https://app-inflectus.appspot.com/v1/events"


Example Results
{
  "items": [
    {
      "name": "Event 1", 
      "created_at": "2013-05-25T12:49:35.686703", 
      "retry_interval": 1, 
      "last_update": "2013-05-25T12:49:35.686713", 
      "max_retries": 10, 
      "href": "https://app-inflectus.appspot.com/v1/events", 
      "event_code": "event_1", 
	  "example": "{\n    \"name\": \"name1\", \n    \"task\": \"taskid\", \n    \"user\": \"user1\"\n}", 
	  "description": "This event is fired when a task is created."      "signature": false, 
      "active": true, 
      "requests": {
        "href": "https://app-inflectus.appspot.com/v1/events/event_1/requests"
      }
    },
    ... more records
  ], 
  "records": 277, 
  "prev": null, 
  "start": "https://app-inflectus.appspot.com/v1/events?page=1&per_page=50", 
  "next": "https://app-inflectus.appspot.com/v1/events?page=2&per_page=50"
}
	
				



Customers

Customers are the individual groups or persons that you provide services for.

List Customers

Returns a list of your customers

Optional Parameters

page: default is 1
The page number that you wish to fetch
per_page: default is 50, max is 200
How many records you want to fetch per page. Default of 50 and max of 200

Returns

A collection of customer objects.

Call Definition
GET "https://app-inflectus.appspot.com/v1/customers"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" "https://app-inflectus.appspot.com/v1/customers"


Example Results
{
  "items": [
    {
      "customer_code": "customer_1", 
      "name": "Customer 1", 
      "url": "https://test.com/myurl", 
      "created_at": "2013-05-25T11:53:44.906003", 
      "auth_pass": "[redacted]", 
      "auth": "none", 
      "last_update": "2013-05-25T11:53:44.906010", 
      "paused": false, 
      "href": "http://127.0.0.1:9080/v1/customers", 
      "signature": null, 
      "auth_user": "", 
      "requests": {
        "href": "http://127.0.0.1:9080/v1/customers/customer_1/requests"
      }
    }
    ... more records
  ], 
  "records": 147, 
  "prev": null, 
  "start": "http://127.0.0.1:9080/v1/customers?page=1&per_page=50", 
  "next": "http://127.0.0.1:9080/v1/customers?page=2&per_page=50" 
}
	
				



Retrieve Customer

Retrieve the specified customer

Required Parameters

customer_code: required
The code for the customer

Returns

A Customer object

Call Definition
GET "https://app-inflectus.appspot.com/v1/customers/:customer_code"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" "https://app-inflectus.appspot.com/v1/customers/customer_1"


Example Results
{
  "customer_code": "customer_1", 
  "name": "Customer 1", 
  "url": "https://test.com/myurl", 
  "created_at": "2013-05-25T11:53:44.906003", 
  "auth_pass": "[redacted]", 
  "auth": "none", 
  "last_update": "2013-05-25T11:53:44.906010", 
  "paused": false, 
  "href": "http://127.0.0.1:9080/v1/customers/customer_1", 
  "signature": null, 
  "auth_user": "", 
  "requests": {
    "href": "http://127.0.0.1:9080/v1/customers/customer_1/requests"
  }
}
	
				



Create Customer

This will create a new customer

Request Parameters

customer_code: required
A unique value for your customer code
name: required
A name for the customer
paused: optional, default is false
If set to true, the customer will no longer be able to receive webhooks. All webhooks created for this customer will be immediately marked as failed.
url: required
the url that will be used to forward all requests. Only ports 80 and 443 will be used.
auth: required
This is the level of authentications supported. Currently the only options are none and basic
auth_user: optional
Used to designate the user name used for basic auth requests
auth_pass: optional
Used as a password for the basic auth requests

Returns

201 Created status and a location to the created record.

Call Definition
POST "https://app-inflectus.appspot.com/v1/customers"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" -X POST \
-d '{"name":"customer 2", "customer_code":"customer_3", "auth":"none", "url":"http://example.com"}' \
"https://app-inflectus.appspot.com/v1/customers"


Example Results
201 Created
location: https://app-inflectus.appspot.com/v1/customers/ahFkZXZ-YXBwLWluZmxlY3R1c3IVCxIIQ3VzdG9tZXIYgICAgICAoAgM

				



Update Customer

This will update an existing customer

Request Parameters

customer_code: optional
The value of the customer code
name: optional
A name for the customer
paused: optional
If set to true, the customer will no longer be able to receive webhooks. All webhooks created for this customer will be immediately marked as failed.
url: optional
the url that will be used to forward all requests. Only ports 80 and 443 will be used.
auth: optional
This is the level of authentications supported. Currently the only options are none and basic
auth_user: optional
Used to designate the user name used for basic auth requests
auth_pass: optional
Used as a password for the basic auth requests

Returns

Returns the updated customer object

Call Definition
PUT "https://app-inflectus.appspot.com/v1/customers/:customer_code"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" -X PUT \
-d '{"name":"customer 6"}' \
"https://app-inflectus.appspot.com/v1/customers/customer_1"


Example Results
{
  "customer_code": "customer_1", 
  "name": "customer 6", 
  "url": "https://mydomain.com/webhooks", 
  "created_at": "2013-06-08T19:18:33.189605", 
  "auth_pass": "[redacted]", 
  "auth": "basic", 
  "last_update": "2013-06-12T19:14:27.265781", 
  "paused": true, 
  "href": "http://127.0.0.1:9080/v1/customers/customer_1", 
  "signature": null, 
  "auth_user": "[redacted]", 
  "requests": {
    "href": "http://127.0.0.1:9080/v1/customers/customer_1/requests"
  }
}
		
					



Delete Customer

This will delete an existing customer

Request Parameters

customer_code: required
The value of the customer code
Call Definition
DELETE "https://app-inflectus.appspot.com/v1/customers/:customer_code"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" -X DELETE \
"https://app-inflectus.appspot.com/v1/customers/customer_1"


Example Results
204 No Content

				



Triggers

Triggers are created when a customer becomes eligible for an event. For instance, when a record is saved, you trigger and "Saved Record" event with the relavant information for the relevant customer.

Create Trigger

This will trigger an event and send the payload to the customer

Request Parameters

customer_code: required
The customer_code that you want to send the payload to
event_code: required
The event_code for the trigger
payload: required
A JSON object
Call Definition
POST "https://app-inflectus.appspot.com/v1/triggers"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" -X POST \
"https://app-inflectus.appspot.com/v1/triggers" \
-d '{"customer_code":"customer_1", "event_code":"event_1", "payload": {"test":"1"}}'


Example Results

201 Created
				


Requests

When a trigger is created, Inflectus will create a request based on the specified parameters designated in the customer record.

List Requests

Returns a list of requests performed

Optional Parameters

page: default is 1
The page number that you wish to fetch
per_page: default is 50, max is 200
How many records you want to fetch per page. Default of 50 and max of 200

Returns

A collection of request objects.

Call Definition
GET "https://app-inflectus.appspot.com/v1/requests"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" "https://app-inflectus.appspot.com/v1/requests"


Example Results
{
  "items": [
    {
      "customer": {
        "href": "https://app-inflectus.appspot.com/v1/customers/ahFkZXZ-YXBwLWluZmxlY3R1c3IVCxIIQ3VzdG9tZXIYgICAgICAwAsM"
      }, 
      "payload": {
        "created_at": "2013-06-12 20:09:06.869456", 
        "event": {
          "data": {
            "test": "1"
          }, 
          "name": "event_1"
        }
      }, 
      "url": "https://mydomain.com/notifcation-endpoint", 
      "trigger": {
        "href": "https://app-inflectus.appspot.com/v1/triggers/ahFkZXZ-YXBwLWluZmxlY3R1c3IUCxIHVHJpZ2dlchiAgICAgICgCgw"
      }, 
      "created_at": "2013-06-12T19:39:18.499080", 
      "auth_pass": "[redacted]", 
      "tries": 1, 
      "auth": "basic", 
      "method": "post", 
      "headers": null, 
      "state": "failed", 
      "href": "https://app-inflectus.appspot.com/v1/requests/ahFkZXZ-YXBwLWluZmxlY3R1c3IUCxIHUmVxdWVzdBiAgICAgIDACQw", 
      "auth_user": "[redacted]", 
      "last_update": "2013-06-12T19:39:18.499087", 
      "type": "webhook", 
      "event": {
        "href": "https://app-inflectus.appspot.com/v1/events/ahFkZXZ-YXBwLWluZmxlY3R1c3ISCxIFRXZlbnQYgICAgICAwAkM"
      }, 
      "handler": null
    },
    ... more records
  ], 
  "records": 277, 
  "prev": null, 
  "start": "https://app-inflectus.appspot.com/v1/requests?page=1&per_page=50", 
  "next": "https://app-inflectus.appspot.com/v1/requests?page=2&per_page=50"
}
	
				


Retrieve Request

Retrieve the specified request

Required Parameters

id: required
The id for the request

Returns

An Request object

Call Definition
GET "https://app-inflectus.appspot.com/v1/requests/:id"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" "https://app-inflectus.appspot.com/v1/requests/ahFkZXZ-YXBwLWluZmxlY3R1c3IUCxIHUmVxdWVzdBiAgICAgIDACQw"


Example Results
{
  "event": {
    "href": "https://app-inflectus.appspot.com/v1/events/ahFkZXZ-YXBwLWluZmxlY3R1c3ISCxIFRXZlbnQYgICAgICAwAgM"
  }, 
  "handler": null, 
  "auth": "basic", 
  "tries": 1, 
  "href": "https://app-inflectus.appspot.com/v1/requests/ahFkZXZ-YXBwLWluZmxlY3R1c3IUCxIHUmVxdWVzdBiAgICAgIDACQw", 
  "payload": {
    "created_at": "2013-06-13 21:49:31.827438", 
    "event": {
      "data": {
        "test": "1"
      }, 
      "name": "event_1"
    }
  }, 
  "customer": {
    "href": "https://app-inflectus.appspot.com/v1/customers/ahFkZXZ-YXBwLWluZmxlY3R1c3IVCxIIQ3VzdG9tZXIYgICAgICAgAsM"
  }, 
  "url": "https://mydomain.com/notification-endpoint", 
  "created_at": "2013-06-13T21:49:32.015298", 
  "auth_pass": "[redacted]", 
  "last_update": "2013-06-13T22:01:05.160639", 
  "headers": null, 
  "state": "completed", 
  "trigger": {
    "href": "https://app-inflectus.appspot.com/v1/triggers/ahFkZXZ-YXBwLWluZmxlY3R1c3IUCxIHVHJpZ2dlchiAgICAgIDACgw"
  }, 
  "auth_user": "[redacted]", 
  "type": "webhook", 
  "method": "post"
}
	
				


Retry Request

This will retry a request that has a state of failed. If the state is not failed, the request to retry will fail.

Required Parameters

id: required
The id for the request

Returns

An empty response

Call Definition
POST "https://app-inflectus.appspot.com/v1/requests/:id/retry"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" -X POST /
"https://app-inflectus.appspot.com/v1/requests/ahFkZXZ-YXBwLWluZmxlY3R1c3IUCxIHUmVxdWVzdBiAgICAgIDACQw/retry"


Example Results
204 No Content

				



Request Transactions

Every time a request is attempted, a Request transaction is created that holds all relevant information related to the request.

Retrieve Request Transaction

Retrieve the specified transaction

Required Parameters

id: required
The id for the transaction

Returns

A Request Transaction object

Call Definition
GET "https://app-inflectus.appspot.com/v1/transactions/:id"


Example Call
curl -u SOMELONGAPIKEY: \
-H "Accept: application/json" \
-H "Content-Type: application/json" "https://app-inflectus.appspot.com/v1/transactions/ahFkZXZ-YXBwLWluZmxlY3R1c3IUCxIHVHJpZ2dlchiAgICAgICgCww"


Example Results
{
  "customer": {
    "href": "https://app-inflectus.appspot.com/v1/customer/ahFkZXZ-YXBwLWluZmxlY3R1c3IVCxIIQ3VzdG9tZXIYgICAgICAwAgM"
  }, 
  "handler": null, 
  "success": true, 
  "response_headers": {
    "x-powered-by": "PHP/5.3.8", 
    "transfer-encoding": "chunked", 
    "vary": "Accept-Encoding", 
    "server": "Apache/2.2.20 (Unix)", 
    "date": "Wed, 26 Jun 2013 15:39:10 GMT", 
    "content-type": "text/html; charset=UTF-8"
  }, 
  "url": "https://mydomain.com/notification-endpoint", 
  "response_status": 200, 
  "created_at": "2013-06-26T15:39:16.409432", 
  "request": {
    "href": "https://app-inflectus.appspot.com/v1/requests/ahFkZXZ-YXBwLWluZmxlY3R1c3IUCxIHUmVxdWVzdBiAgICAgIDgCAw"
  }, 
  "event": {
    "href": "https://app-inflectus.appspot.com/v1/events/ahFkZXZ-YXBwLWluZmxlY3R1c3ISCxIFRXZlbnQYgICAgICAgAsM"
  }, 
  "request_payload": {
    "created_at": "2013-06-26 15:39:15.194788", 
    "event": {
      "data": {
        "test": "1"
      }, 
      "name": "event_1"
    }
  }, 
  "method": "post", 
  "href": "https://app-inflectus.appspot.com/v1/transactions/ahFkZXZ-YXBwLWluZmxlY3R1c3IfCxISUmVxdWVzdFRyYW5zYWN0aW9uGICAgICAgOAKDA", 
  "request_headers": null, 
  "response_payload": "everything went great", 
  "trigger": {
    "href": "https://app-inflectus.appspot.com/v1/triggers/ahFkZXZ-YXBwLWluZmxlY3R1c3IUCxIHVHJpZ2dlchiAgICAgICgCww"
  }	
}
	
				


Webhooks


Webhook Format

When a webhook is sent, the JSON object is POSTed to the customer's URL.
Payload Values

event_code
The event_code that relates to the hook
event
An array which includes the data and the name of the event

Example Webhook

{
 "created_at": "2013-06-27 12:50:56.769086", 
 "event": {
 	"data": {
 		"account_code": "1",
 		"payment_amount": "939.00"
 	}, 
 	"name": "payment"
 }
}