Community
Showing results for 
Search instead for 
Do you mean 
Reply

Getting contact's all documents

New Member
Posts: 2
Country: India

Getting contact's all documents

[ Edited ]

I am having trouble to get all documents of specific contact.  

 

I've tried below things.

 

API: /Act.Web.API/api/Documents

[
    {
        "contacts": [],
        "id": "ee486b71-b780-4bfe-816f-28027eadff3a",
        "manageUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "createUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "isPrivate": false,
        "details": "",
        "regarding": "city.txt",
        "duration": "0 minutes",
        "startTime": "2017-04-25T08:18:00-04:00",
        "endTime": "2017-04-25T08:18:00-04:00",
        "historyTypeID": -1,
        "created": "2017-04-25T08:18:19-04:00",
        "edited": "2017-04-25T08:18:19-04:00"
    },
    {
        "contacts": [],
        "id": "9d9d09bc-d4c8-4963-bde2-3b2cbe500075",
        "manageUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "createUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "isPrivate": false,
        "details": "",
        "regarding": "this_is_test_1.pdf",
        "duration": "0 minutes",
        "startTime": "2017-05-01T08:14:00-04:00",
        "endTime": "2017-05-01T08:14:00-04:00",
        "historyTypeID": -1,
        "created": "2017-05-01T04:14:13-04:00",
        "edited": "2017-05-01T04:14:13-04:00"
    },
    {
        "contacts": [],
        "id": "3d550e79-bb3c-49be-9da5-b3b9313bd8d9",
        "manageUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "createUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "isPrivate": false,
        "details": "",
        "regarding": "this_is_test_1.pdf",
        "duration": "0 minutes",
        "startTime": "2017-05-01T08:31:00-04:00",
        "endTime": "2017-05-01T08:31:00-04:00",
        "historyTypeID": -1,
        "created": "2017-05-01T04:30:51-04:00",
        "edited": "2017-05-01T04:30:51-04:00"
    },
    {
        "contacts": [
            {
                "id": "8a808bdf-1a84-4d2b-9c57-074434dee007",
                "displayName": "asd asd",
                "fullName": "asd asd",
                "company": null,
                "emailAddress": null
            }
        ],
        "id": "27db9d5f-d320-4ce8-ad7e-eaa7f73f37b1",
        "manageUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "createUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "isPrivate": false,
        "details": "",
        "regarding": "client-type.txt",
        "duration": "0 minutes",
        "startTime": "2017-06-01T08:05:00-04:00",
        "endTime": "2017-06-01T08:05:00-04:00",
        "historyTypeID": -1,
        "created": "2017-06-01T08:05:03-04:00",
        "edited": "2017-06-01T08:05:03-04:00"
    },
    {
        "contacts": [],
        "id": "da715007-dfe3-46f1-8cb5-eeb988d12f83",
        "manageUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "createUserID": "dddf85b7-a841-41b4-8612-2fa7a9abbbba",
        "isPrivate": false,
        "details": "",
        "regarding": "error2.png",
        "duration": "0 minutes",
        "startTime": "2017-06-01T07:49:00-04:00",
        "endTime": "2017-06-01T07:49:00-04:00",
        "historyTypeID": -1,
        "created": "2017-06-01T07:48:59-04:00",
        "edited": "2017-06-01T07:48:59-04:00"
    }
]

 

 

Now, I want to filter by contact Id "8a808bdf-1a84-4d2b-9c57-074434dee007" so, I tried below query but I got  same all the records however, I should get 3rd record only. 

 

/Act.Web.API/api/Documents?$expand=contacts($filter=id eq 05018105-93cb-45ab-a324-768e0ad8e2c2)

and I tried this too and getting error below.

 

/Act.Web.API/api/Documents?$filter=contacts/any(c:c/id eq 8a808bdf-1a84-4d2b-9c57-074434dee007)

Error:
 

{
    "message": "An error has occurred.",
    "exceptionMessage": "",
    "exceptionType": "System.Exception",
    "stackTrace": "   at Act.Framework.ComponentModel.BaseManagerDB.GetDataKeys(SortCriteria[] sortCriteria, InitialFetchCancellingMonitor cancellingMonitor)\r\n   at Act.Framework.ComponentModel.BaseManagerDB.GetDataKeys(SortCriteria[] sortCriteria)\r\n   at Act.Shared.Collections.DataList`1.Init()\r\n   at Act.Shared.Collections.DataList`1..ctor(SortCriteria[] sortCriteria, Object dataSource, Int32 batchSize, Boolean deferInitialKeyFetch)\r\n   at Act.Framework.Histories.HistoryList..ctor(SortCriteria[] sortOrder, Object dataSource)\r\n   at Act.Framework.Histories.HistoryManager.GetHistories(HistorySortCriteria[] sortCriteria, IFilterCriteria[] filterCriteria)\r\n   at act.web.api.Services.HistoryService.Get(ActFramework framework, IDictionary`2 mappers, List`1 filters, ODataQueryOptions`1 options)\r\n   at act.web.api.Services.HistoryService.GetHistoryDocuments(ActFramework framework, IDictionary`2 mappers, ODataQueryOptions`1 options)\r\n   at act.web.api.Controllers.DocumentsController.Get(ODataQueryOptions`1 options)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at act.web.api.Security.SecureMessageAttribute.<ExecuteActionFilterAsync>d__c.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Cors.CorsMessageHandler.<SendAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()",
    "innerException": {
        "message": "An error has occurred.",
        "exceptionMessage": "Invalid column name 'ID'.",
        "exceptionType": "Act.Data.ActDb.ActDbException",
        "stackTrace": "   at Act.Data.ActDb.ActDbCommand.ExecuteReader(CommandBehavior behavior)\r\n   at Act.Data.CommandProcessor.Execute(Command command, IDataReader& dataReader)\r\n   at Act.Framework.ComponentModel.BaseManagerDB.GetDataKeys(SortCriteria[] sortCriteria, InitialFetchCancellingMonitor cancellingMonitor)",
        "innerException": {
            "message": "An error has occurred.",
            "exceptionMessage": "Invalid column name 'ID'.",
            "exceptionType": "System.Data.SqlClient.SqlException",
            "stackTrace": "   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()\r\n   at System.Data.SqlClient.SqlDataReader.get_MetaData()\r\n   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)\r\n   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)\r\n   at Act.Data.ActDb.ActDbCommand.ExecuteReader(CommandBehavior behavior)"
        }
    }
}

 

Any help would be appreciated!

Thanks,

Jimit

Administrator
Posts: 4,024
Country: United_Kingdom

Re: Getting contact's all documents

Hi Jimit,

 

I requested some info from the development team as to why this isn't currently working. Here's a summary of the information I've received:

 

We currently do not support filtering on sub-related collection entities, in this case Contacts. OData specification would suggest it be done like this, however, due to limitations in the Act! SDK, the API does not currently support filtering by Contacts on Documents.

 

The API is continually being expanded, and so we've written up a feature request to allow for Documents to be returned in requests for Contacts by ID. This is something that will be investigated and added to the roadmap for future implementation.

New Member
Posts: 2
Country: India

Re: Getting contact's all documents

[ Edited ]

Thank you Gary and Act development team for prompt reply. Will you please update here, once this feature will be implemented? I guess it should be easy to allow this kind of oData query and allow support soon.

Administrator
Posts: 4,024
Country: United_Kingdom

Re: Getting contact's all documents

Yes, I'll make a note of it.