The Invoice Emails REST API is designed to provide access for a corporate client to all their incoming emails (received by the eBillingHub form Vendors).
The operation returns emails by specified search parameters.
| Method | Request URI | HTTP Version |
|---|---|---|
| POST | {eBHDomain}/emails/api/v1/search | HTTP/1.1 |
The following table describes required and optional request headers.
| Request header | Description |
|---|---|
| ProducerId | Required. Specifies the client on behalf of which the request is sent. |
| ProviderKey | Required. Specifies the access token. |
| Content-Type | Required. Specifies the body format. A list of valid values: application/json. |
| Username | Optional. Specifies the user on behalf of which the request is sent. The value is used for reporting purposes only and defined by the caller. |
| Accept | Optional. Specifies the expected response format. A list of valid values: application/json (default), */*. |
The following table describes required and optional body string parameters.
| Parameter | Description |
|---|---|
| StartDate |
Optional. UTC
Start Date of Date Range (Email received date) E.g., "startDate": "5/16/2018" |
| EndDate |
Optional. UTC End Date of Date Range (Email received date) E.g., "endDate": "5/18/2018" |
| Subject | Optional. Email subject (a short description of an email). |
| From | Optional. Email from (address, sender). |
| InvoiceId | Optional. Billing organization’s assigned invoice number or code for which to obtain emails. |
{
"StartDate": "2018-05-16T05:50:06",
"EndDate": "2018-05-18T07:30:00",
"Subject": "has paid",
"From": "@biller.com",
"InvoiceId": "141732"
}
The response includes an HTTP status code, a set of response headers and a response body, which contains an array of email objects.
A successful operation returns status code 200 (OK).
| Status code | Description |
|---|---|
| 200 OK | The request was created successfully. See the response body for details. |
| 400 BAD REQUEST | The request was incorrectly formatted, missing a required header or parameters were invalid. |
| 401 UNAUTHORIZED | The Provider Key is not authorized. |
| 403 FORBIDDEN | The requestor is not authorized to view the response. |
| 406 NOT ACCEPTABLE | Provided Accept HTTP Header is not supported. |
| 415 UNSUPPORTED MEDIA TYPE | Provided Content-Type HTTP Header is not supported. |
| 500 INTERNAL SERVER ERROR | Something went wrong. |
| Response header | Description |
|---|---|
| OperationId | The unique identifier associated with the request. |
A request was successfully processed:
{
"Message": "Returning the latest 1000 emails, please specify more specific criteria to narrow your results.",
"Emails":[
{
"Id": "16452850",
"Date": "2016-11-06 02:33:16.000Z",
"To": "john@xiller.com",
"From": "noreply@xiller.com",
"Subject": "Xiller has paid your invoice # 11111"
}
]
}
An error occurred while processing a request:
{
"Message": "An unexpected error occurred. Please, contact the support team."
}
The operation returns an email by Id.
| Method | Request URI | HTTP Version |
|---|---|---|
| GET | {eBHDomain}/emails/api/v1/email/{id} | HTTP/1.1 |
The following table describes required and optional URI parameters.
| Parameter | Description |
|---|---|
| Id | Required. An email identifier returned in the response from Email API SEARCH request |
The following table describes required and optional request headers.
| Request header | Description |
|---|---|
| ProducerId | Required. Specifies the client on behalf of which the request is sent. |
| ProviderKey | Required. Specifies the access token. |
| Username | Optional. Specifies the user on behalf of which the request is sent. The value is used for reporting purposes only and defined by the caller. |
| Accept | Optional. Specifies the expected response format. A list of valid values: application/json (default), */*. |
The response includes an HTTP status code, a set of response headers and a response body, which contains an email object.
A successful operation returns status code 200 (OK).
| Status code | Description |
|---|---|
| 200 OK | The request was created successfully. See the response body for details. |
| 400 BAD REQUEST | The request was incorrectly formatted, missing a required header or parameters were invalid. |
| 401 UNAUTHORIZED | The Provider Key is not authorized. |
| 403 FORBIDDEN | The requestor is not authorized to view the response. |
| 404 NOT FOUND | An email was not found. |
| 406 NOT ACCEPTABLE | Provided Accept HTTP Header is not supported. |
| 500 INTERNAL SERVER ERROR | Something went wrong. |
| Response header | Description |
|---|---|
| OperationId | The unique identifier associated with the request. |
A request was successfully processed:
{
"Date": "2016-11-06 02:33:16.000Z",
"To": "john@xiller.com",
"From": "noreply@xiller.com",
"Cc": "administrator@xiller.com",
"Subject": "Xiller has paid your invoice # 11111",
"Body": "<html><body><p>Invoice has been paid: #11111</p></body></html>"
}
An error occurred while processing a request:
{
"Message": "An unexpected error occurred. Please, contact the support team."
}