Repliconnect API can be used to access and edit your Replicon data, and to create custom integration with third party software. The Repliconnect queries can run from within the application using the API test page and can be run from third party applications using programs such as C#, C++, Ruby etc.

The following query is being run outside Repliconnect API in a third party application to retrieve timesheet data (rows and cells) of users:

    [
    {
    "Action": "Query",
    "QueryType": "TimesheetsByUserModifiedSince",
    "DomainType": "Replicon.TimeSheet.Domain.Timesheet",
    "Args": [
    {
    "Type": "Replicon.Domain.User",
    "Identity": "1010"
    },
    {
    "Type": "DateTime",
    "Year": 2012,
    "Month": 5,
    "Day": 7,
    "Hour": 7,
    "Minute": 0,
    "Second": 0
    }
    ],
    "Load": [
    {
    "Relationship": "User"
    },
    {
    "Relationship": "FilteredHistory"
    },
    {
    "Relationship": "TimeRows",
    "Load": [
    {
    "Relationship": "Task",
    "Load": [
    {
    "Relationship": "Project"
    }
    ]     },
    {
    "Relationship": "Cells"
    }
    ]     }
    ]     }
    ]

While attempting to send the above query as a request through a C# program using System.Net http related objects , the following JSON error comes up:

    {
    "Status": "Exception",
    "Type": "Replicon.Data.Orm.Security.Exceptions.LoadDeniedSecurityException",
    "Message": "Permission denied by security module, not permitted to load entity of type Replicon.TimeSheet.Schema.ReportPeriod+Entity",
    "ActionIndex": 0
    }

However the same query is executed successfully if it is run using Repliconnect API Test Interface.

Resolution:
The following query needs to be first run from the third party application in order to initiate a session with Replicon Web TimeSheet. Once the session is initiated, the query to retrieve timesheet data of users can be sent as a request through a C# program using System.Net http related objects.

    {
    try
    {
    var request = (HttpWebRequest)WebRequest.Create(this.ApiUrl);

    request.Credentials = new NetworkCredential(this.LoginName, this.Password);
    request.PreAuthenticate = true; // send auth on first request
    request.Method = "POST";
    request.ContentType = "application/json; charset=utf-8";