99Inbound Docs

As well as linking your form directly to 99Inbound, you can also submit entries programatically.

To do this, you use the same API endpoint URL that you would embed in your form.

Form endpoint api screenshot

API Set-up

You need to POST to the API endpoint with your form values serialized into a JSON object in the body of the request.

You’ll need to set 2 headers to tell 99Inbound that you are using JSON:

  Content-Type: application/json # tell 99Inbound to accept json
  Accept: application/json       # tell 99Inbound you want a json response

The body of your request should be JSON with key:value pairs for the form fields. You can have as many key:value pairs you wish, but values will always be interpreted as strings.

For example:

{"name": "Matthew Example", "email": "matthew@example.fom"}

Language Examples

Curl

curl \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --request POST \
  --data '{"name":"Matthew Example","email":"matthew@example.com"}' \
  https://app.99inbound.com/api/e/123456

Javascript Example

NB: This example uses the Axios HTTP library

// Send a POST request with Axios
axios({
  method: 'post',
  url: 'https://app.99inbound.com/api/e/123456',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  },
  data: {
    name: 'Matthew Example',
    email: 'matthew@example.com'
  }
}).then((response) => { console.log(response); })

Ruby Example

This example uses the HTTParty gem

result = HTTParty.post(
  'https://app.99inbound.com/api/e/123456',
  body: {
    "name": "Matthew Example",
    "email": "matthew@example.com"
  }.to_json,
  headers: {
    "Content-Type": "application/json",
    "Accept": "application/json"
  }
)

PHP Example

This example uses the Guzzle library.

$client = new Client([
    'headers' => [ 'Content-Type' => 'application/json', 'Accept' => 'application/json' ]
]);

$response = $client->post('https://app.99inbound.com/api/e/123456',
    ['body' => json_encode(
        [
            'name' => 'Matthew Example',
            'email' => 'matthew@example.com'
        ]
    )]
);

Java Example

This example uses the Apache HTTP Client.

CloseableHttpClient client = HttpClients.createDefault();
HttpPost httpPost = new HttpPost("https://app.99inbound.com/api/e/123456");
String json = "{\"name\":\"Matthew Example\",\"email\":\"matthew@example.com\"}";
StringEntity entity = new StringEntity(json);
httpPost.setEntity(entity);
httpPost.setHeader("Accept", "application/json");
httpPost.setHeader("Content-Type", "application/json");
 
CloseableHttpResponse response = client.execute(httpPost);
client.close();