eDocs - Rest API - "Lookup" questions
Hi,
1 - In the following endpoint I known that the profile parameter is the name of the form but what is the key parameter and where I can look for it?
2 - Is there how to known the total entries of a lookup table?
3 - How can I use the filter query parameter to seach for more than one field with an or clause? For example I want to be able to search for all the fields below.
Thanks
Comments
-
1) Lookups are related to the fields on forms so the first thing you'll need to do is examine the form definition (profile) for the specific lookup field using:
GET .../edocsapi/v1.0/forms/<formname>/profile?library=<library>
Example of the definition for the CLIENT_ID field found on the LEGALPROF form:
Here you'll find CLIENT (lookup) is the name of the table and CLIENT_ID (name) is the key
Making your lookup request look like this:
GET .../edocsapi/v1.0/lookups/CLIENT?library=<library>&profile=<formname>&key=CLIENT_ID
2) The reply will contain set information about the list of items returned and there you will find the total number of items available.
3) Use the standard start, max and filter parameters to return only a subset of the total items
To limit the items returned based on certain criteria then you would use the filter parameter.
Example to only return the MATTER_IDs that pertain to a specific CLIENT_ID
filter=CLIENT_ID=<id>
0 -
The lookup retrievals will always start with the first record but can be set to less than the system default by using the max parameter.
Multiple fields can be used in the filter parameter. filter=CLIENT_ID=<value> and MATTER_ID=<value>
0 -
The number of records in the actual table is not available through the REST API only the number of items that are available because of either system limits or permissions.
0 -
Lookups are for finding something quickly so I would suggest using filters to show subsets of what could be a very large list.
For example you may have a user base of over a thousand users and your trying to locate someone with a name that starts with 'N'. You could add filter=AUTHOR_ID=N* or FULL_NAME=N* to only return records of the users who's user id and/or name start with 'N'. This could be extended further to include the first couple of letters.
0 -
Thank you, I am dynamically building a form for an upload, I have to present all the necessary fields and if they have a lookup, the user can search for the record in a modal, in this modal he will have an input to search, such as the maximum of records is always 250 I will no longer do the paging on the server.
When I try to filter 2 fields with an or in between like your last comment I am getting the error below, It works with an and.
Seems like a parse error, any idea?
Thanks!
0 -
Try URL encoding the individual parameter values
filter=AUTHOR_ID=N* or FULL_NAME=N*
would become
filter=AUTHOR_ID%3DN%2A%20or%20FULL_NAME%3DN%2A
0 -
With enconding (CLIENTE_NOME_X=O* or PART_CONT_NOME_X=P*)
Even without the * (CLIENTE_NOME_X=O or PART_CONT_NOME_X=P)
Api version:
"SERVER_INFO": {
"CODE_REVISION": "32",
"VERSION": "16.3.0",
"NAME": "OpenText eDOCS REST API Server",
"BUILD": "001"
},
I have tried enconding without * too
CLIENTE_NOME_X=O or PART_CONT_NOME_X=P => CLIENTE_NOME_X%3DO%20or%20PART_CONT_NOME_X%3DP
Response:
Traceback (most recent call last):
File "edocs\web\server.py", line 267, in HandleGETRequest
File "edocs\controllers\lookups.py", line 30, in Get
File "edocs\apihandlers\lookups.py", line 302, in GetId
File "edocs\apihandlers\default.py", line 704, in AddUserFilterCriteria
TypeError: unicode string expected instead of list instance
0 -
The ability to execute an "or" was introduced in a later version of the REST API. Try just sending one of the fields
1 -
Multiple calls and merging results is basically what the REST API does
1
Categories
- All Categories
- 122 Developer Announcements
- 52 Articles
- 148 General Questions
- 146 Thrust Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 917 Cloud Fax and Notifications
- 83 Digital Asset Management
- 9.4K Documentum
- 30 eDOCS
- 178 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 7 XM Fax
- Follow Categories