Web Services Reporting Developer Guide

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 25

25
............................................................................................................................ 1
................................................................................................................................ 2
.............................................................................................................................................................. 2
............................................................................................................................................................. 3
.............................................................................................................................................. 4
.............................................................................................................................................................. 21
.................................................................................................................................. 21
................................................................................ 22
................................................................................ 22
.................................................................................................................................................. 23
........................................................................................................................................ 23
.................................................................................................................................................................. 24
25
25
http://en.wikipedia.org/wiki/Symmetric-key_algorithm.
o
o
o
25
static void getDocumentTypeList()
{
ApiClient client = new ApiClient(serverName, publicKey, privateKey);
try
{
var res = client.GetDocumentTypeList();
foreach (var r in res)
{
Console.WriteLine(r);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
25
Public Sub getDocumentTypeList()
Dim client As New ApiClient(serverName, publicKey, privateKey)
Try
Dim res = client.GetDocumentTypeList()
For Each r In res
Console.WriteLine(r)
Next
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try
End Sub
public static void getDocumentTypeList() {
ApiClient client = new ApiClient(serverName,publicKey,privateKey);
try {
String[] types = client.getDocumentTypeList();
for(int x=0;x<types.length;x++) {
System.out.println(types[x]);
}
} catch (Exception e) {
e.printStackTrace();
}
}
DocumentApiConsole.exe lt --list
25
25
25
static void getDocumentList(string documentType, ParameterValue[] parameters)
{
ApiClient client = new ApiClient(serverName, publicKey, privateKey);
try
{
var res = client.GetDocumentList(documentType, parameters, null, null);
ConsoleUtils.PrintTable(res.Items,
new string[] { "DocumentName", "Id", "DocumentUrl" },
new int[] { DOC_NAME_LENGTH, DOC_ID_LENGTH, DOC_URL_LENGTH });
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
25
Public Sub getDocument(documentType As String, id As String, parameters As
ParameterValue(), localPath As String)
Dim client As New ApiClient(serverName, publicKey, privateKey)
Try
client.GetDocument(documentType, id, localPath, parameters)
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try
End Sub
public static void getDocument(String documentType, String id, ParameterValue[]
parameters, String localPath){
ApiClient client = new ApiClient(serverName,publicKey,privateKey);
try {
client.getDocument(documentType, id, parameters, localPath);
} catch (Exception e) {
e.printStackTrace();
}
}
DocumentApiConsole.exe t <documentType> --list [p Param1=value1]
25
25
static void getParameterList(string documentType, ParameterValue[] parameters)
{
ApiClient client = new ApiClient(serverName, publicKey, privateKey);
try
{
var res = client.GetParameters(documentType, null, parameters);
ConsoleUtils.PrintTable(res.Parameters,
new string[] { "Name", "Prompt", "DataType" },
new int[] { FIELD_LENGTH, FIELD_LENGTH, FIELD_LENGTH });
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
Public Sub getParameterList(documentType As String, parameters As ParameterValue())
Dim client As New ApiClient(serverName, publicKey, privateKey)
Try
Dim res = client.GetParameters(documentType, Nothing, parameters)
ConsoleUtils.PrintTable(res.Parameters,
New String() {"Name", "Prompt", "DataType"},
New Integer() {FIELD_LENGTH, FIELD_LENGTH, FIELD_LENGTH})
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try
End Sub
25
public static void getParameterList(String documentType, ParameterValue[] parameters)
{
ApiClient client = new ApiClient(serverName,publicKey,privateKey);
try {
ParameterList lst = client.getParameters(documentType, null, parameters);
ConsoleUtils.printTable(lst.Parameters,
new String[]{"Name","Prompt","DataType"},
new int[]{FIELD_LENGTH,FIELD_LENGTH,FIELD_LENGTH} );
} catch (Exception e) {
e.printStackTrace();
}
}
DocumentApiConsole.exe t <documentType> --list -i
25
static void getParameterList(string documentType, string id,
ParameterValue[] parameters)
{
ApiClient client = new ApiClient(serverName, publicKey, privateKey);
try
{
var res = client.GetParameters(documentType,id, parameters);
ConsoleUtils.PrintTable(res.Parameters,
new string[] { "Name", "Prompt", "DataType" },
new int[] { FIELD_LENGTH, FIELD_LENGTH, FIELD_LENGTH });
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
25
Public Sub getParameterList(documentType As String, id As String,
parameters As ParameterValue())
Dim client As New ApiClient(serverName, publicKey, privateKey)
Try
Dim res = client.GetParameters(documentType, id, parameters)
ConsoleUtils.PrintTable(res.Parameters,
New String() {"Name", "Prompt", "DataType"},
New Integer() {FIELD_LENGTH, FIELD_LENGTH, FIELD_LENGTH})
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try
End Sub
public static void getParameterList(String documentType,String id,ParameterValue[]
parameters) {
ApiClient client = new ApiClient(serverName,publicKey,privateKey);
try {
ParameterList lst = client.getParameters(documentType, id, parameters);
ConsoleUtils.printTable(lst.Parameters,
new String[]{"Name","Prompt","DataType"},
new int[]{FIELD_LENGTH,FIELD_LENGTH,FIELD_LENGTH} );
} catch (Exception e) {
e.printStackTrace();
}
}
DocumentApiConsole.exe t <documentType> -r <id> -i
25
static void createDocument(string documentType, string id, ParameterValue[]
parameters)
{
ApiClient client = new ApiClient(serverName, publicKey, privateKey);
try
{
var res=client.CreateDocument(documentType, id, parameters);
ConsoleUtils.PrintTable(new DocumentItem[]{res},
new string[] { "DocumentName", "Id", "DocumentUrl"
},
new int[] { DOC_NAME_LENGTH, DOC_ID_LENGTH,
DOC_URL_LENGTH });
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
25
Public Sub createDocument(documentType As String, id As String, parameters As
ParameterValue())
Dim client As New ApiClient(serverName, publicKey, privateKey)
Try
Dim res = client.CreateDocument(documentType, id, parameters)
ConsoleUtils.PrintTable(New DocumentItem() {res},
New String() {"DocumentName", "Id",
"DocumentUrl"},
New Integer() {DOC_NAME_LENGTH, DOC_ID_LENGTH,
DOC_URL_LENGTH})
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try
End Sub
public static void createDocument(String documentType, String id, ParameterValue[]
parameters) {
ApiClient client = new ApiClient(serverName,publicKey,privateKey);
try {
DocumentItem i = client.createDocument(documentType, id, parameters);
List<DocumentItem> lst = new ArrayList<DocumentItem>();
lst.add(i);
ConsoleUtils.printTable(lst,
new String[]{"DocumentName","Id","DocumentUrl"},
new int[]{DOC_NAME_LENGTH,DOC_ID_LENGTH,DOC_URL_LENGTH} );
} catch (Exception e) {
e.printStackTrace();
}
}
DocumentApiConsole.exe t <documentType> -c [p Param1=value1]
25
static void getDocument(string documentType, string id, ParameterValue[] parameters,
string localPath)
{
ApiClient client = new ApiClient(serverName, publicKey, privateKey);
try
{
client.GetDocument(documentType, id, localPath, parameters);
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
Public Sub getDocument(documentType As String, id As String, parameters As
ParameterValue(), localPath As String)
Dim client As New ApiClient(serverName, publicKey, privateKey)
Try
client.GetDocument(documentType, id, localPath, parameters)
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try
End Sub
25
public static void getDocument(String documentType, String id, ParameterValue[]
parameters, String localPath){
ApiClient client = new ApiClient(serverName,publicKey,privateKey);
try {
client.getDocument(documentType, id, parameters, localPath);
} catch (Exception e) {
e.printStackTrace();
}
}
DocumentApiConsole.exe t <documentType> -r <id> --local-path <path to save the document>
25
static void deleteDocument(string documentType, string id)
{
ApiClient client = new ApiClient(serverName, publicKey, privateKey);
try
{
client.DeleteDocument(documentType, id);
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
Public Sub deleteDocument(documentType As String, id As String )
Dim client As New ApiClient(serverName, publicKey, privateKey)
Try
client.DeleteDocument(documentType, id)
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try
End Sub
25
public static void deleteDocument (String documentType)
{
ApiClient client = new ApiClient(serverName,publicKey,privateKey);
try {
client.deleteDocument(documentType, id);
} catch (Exception e) {
e.printStackTrace();
}
}
DocumentApiConsole.exe t <documentType> -d <id>
25
25
File
Description
NewtonSoft.Json.dll
Library included for Json handling
Paycor.Client.Connectivity.exe
The Paycor API Connectivity Test tool executable
Paycor.Documents.Client.dll
System.Net.Http.Formatting.dll
The System.Net.Http.Formatting contains classes for serializing and
deserializing HTTP message body in a format based on the requested media
type.
25
The Paycor API Connectivity Test Tool runs three simple tests to make sure that you are able to connect, able to
place a call to the Paycor server and able to authenticate using your public and private key.
First, the test tool will verify that you are able to connect to our server. If you encounter a failure at this point, you
will need to check your local network and firewall rules to assure that traffic to https://secure.paycor.com is not
blocked.
This first test will also provide you with the IP Address that Paycor has for your request. Because Paycor only allows
traffic from a set IP range, you will want to verify that this IP address is the expected value. Paycor will deny access
to any API calls that originate outside of the allowed range.
Next, the test tool will verify that your system is able to place a call to the Web Services Reporting API. The test tool
calls one of the methods that do not require authentication to verify that there are no obstacles between the two
systems.
Finally, using the public and private key provided, the test tool places a call to a secure method. This verifies that
your public and private keys are correct and that Paycor can authenticate traffic using these keys. If a failure results
from this call but the prior test is successful, the root cause is most likely an authentication error.
If you find that you must contact Paycor technical support for assistance with an API problem, please include the
test results from the connectivity tool. This will help Paycor troubleshoot your issue. To generate a text file with
these results, press the ‘Save Results’ button after running a test.
Please note that Paycor will only discuss credential or security issues with persons who have already been previously
cleared to represent the Paycor customer. You may need to contact someone in your business who already has
established the relationship with Paycor.
25
25

Navigation menu