The generic intake endpoint accepts documents from any system that is capable of delivering to a REST API endpoint.
The endpoint accepts metadata values as a set of simple key value pairs followed by a single file containing the incoming document.
Request Details
To submit a document to the platform via the generic endpoint, construct an HTTP POST request with the multipart form data content type, and the headers and content sections described below:
Name | Location | Sample Value & Description |
|---|---|---|
X-Auth-User | Header | 12345 The NEXTSTEP user account number used for authentication This will be provided by Concord Customer Success team |
X-Auth-ApiKey | Header | 12345-6789-1212-12345-0001 The API key for the provided NEXTSTEP user account This will be provided by Concord Customer Success team |
metadata | Content Section | The document metadata as a JSON object. |
file | Content Section | <binary file data> The bytes representing the raw file content for the fax file |
Name | Sample Value & Description |
|---|---|
sourceId | bbe58db7-b3f3-461a-9c47-5b803586cc53 A source message identifier that is generated by the originating system. The Source message identifier will be created if one is not passed in. (Optional) |
folderId | The folder the document should be stored in. |
properties | A set of name-value pairs that define additional metadata that should be stored with the document. |
Example
An example HTTP POST request for the intake API (in raw text format) is provided below:
| Example | |
|---|---|
POST /api/intake HTTP/1.1
Host: https://nsapi.concord.net
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
X-Auth-User: 12345
X-Auth-ApiKey: 12345-6789-1212-12345-0001
Content-Disposition: form-data; name="metadata"
{
"queueId": "1234567892",
"sourceId": "bbe58db7-b3f3-461a-9c47-5b803586cc53",
"folderId":"00000000-0000-0000-0000-000000000000",
"properties": {
"name1": "value1",
"name2": "value2",
"name3": "value3"
}
}
Content-Disposition: form-data; name="file"; filename="undefined"
Content-Type: file
<binary file data>
------WebKitFormBoundary7MA4YWxkTrZu0gW-- | |
Postman
A Postman sample script is provided below:
| Postman sample | |
|---|---|
{
"info": {
"_postman_id": "b86d8ef9-2a8e-4b43-a8bd-7c9f2272c56f",
"name": "NEXTSTEP API Samples",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Document Intake - Generic",
"request": {
"method": "POST",
"header": [
{
"key": "X-Auth-User",
"value": "12345",
"type": "default"
},
{
"key": "X-Auth-ApiKey",
"value": "12345-6789-1212-12345-0001",
"type": "default"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "metadata",
"value": "{\n\"queueId\": \"1234567892\",\n\"sourceId\": \"bbe58db7-b3f3-461a-9c47-5b803586cc53\",\n\"folderId\":\"00000000-0000-0000-0000-000000000000\",\n\"properties\": {\"SourceDocument\": \"00000000-0000-0000-0000-000000000000\"}\n}",
"type": "default"
},
{
"key": "file",
"type": "file",
"src": "/C:/_Sample Documents/Test Fax.pdf"
}
]
},
"url": {
"raw": "https://nsapi.concord.net/api/intake",
"protocol": "https",
"host": [
"nsapi",
"concord",
"net"
],
"path": [
"api",
"intake"
]
}
},
"response": []
}
]
} | |
.NET/C# Sample
A .NET/C# sample is provided below:
| C# sample | |
|---|---|
private static void DocumentIntakeFaxprivate static void DocumentIntakeGeneric()
{
// The URL to the NEXTSTEP API
const string NextstepApiEndpoint = @"https://nsapi.concord.net/";
// The NEXTSTEP API User/Key values. You may need to contact Concord support to have them generate these for you.
const string NextstepApiUser = @"12345";
const string NextstepApiKey = @"12345-6789-1212-12345-0001";
// Trim any trailing slash from the NEXTSTEP API endpoint
string faxNotifyUrl = NextstepApiEndpoint.TrimEnd("/".ToCharArray());
// Add the fax notify path to the NEXTSTEP API URL
faxNotifyUrl = $"{faxNotifyUrl}/api/intake";
// Create our multi-part form data object
MultipartFormDataContent content = new MultipartFormDataContent();
// Create our document intake request object
DocumentIntakeRequest request = new DocumentIntakeRequest
{
QueueId = @"1234567892",
SourceId = @"bbe58db7-b3f3-461a-9c47-5b803586cc53",
FolderId = @"00000000-0000-0000-0000-000000000000",
Properties = new Dictionary<string, string>
{
{ @"SourceDocument", @"00000000-0000-0000-0000-000000000000" }
}
};
// Assign the document intake request object to the multi-part form data object
content.Add(new StringContent(JsonConvert.SerializeObject(request)), @"metadata");
// Add a PDF file to the request
byte[] fileBytes = File.ReadAllBytes(@".\Test Fax.pdf");
ByteArrayContent fileByteArray = new ByteArrayContent(fileBytes);
fileByteArray.Headers.ContentType = MediaTypeHeaderValue.Parse(@"application/pdf");
content.Add(fileByteArray, "\"file\"", $"\"Test Fax.pdf\"");
try
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Clear();
client.DefaultRequestHeaders.Add(@"X-Auth-User", NextstepApiUser);
client.DefaultRequestHeaders.Add(@"X-Auth-ApiKey", NextstepApiKey);
client.BaseAddress = new Uri(faxNotifyUrl);
HttpResponseMessage response = client.PostAsync(faxNotifyUrl, content).Result;
string result = response.Content.ReadAsStringAsync().Result;
}
}
catch (Exception ex)
{
// Just outputting the exception details, this exception would normally be handled differently
Console.WriteLine($"EXCEPTION: {ex.Message}");
}
} | |