Changes

Jump to: navigation, search

Odata Overview

1,296 bytes added, 19:53, 17 October 2022
Troubleshooting
==OData Services Endpoints==
SmartSimple OData provides two endpoints: Private and Public Access Endpoints.<br />
Endpoints will return a list of collections available(Reports that are OData enabled).Enable [https://wiki.smartsimple.com/wiki/OData_Connector OData ConnectConnector] to use these endpoints.
===Private Access Endpoint===
Version 2: https: //mysmartsimpleurl/OData/'''V2'''/'''pub'''/424623/Service.svc/
==How to setup an authenticated user to consume a private OData Service==For [[JSON API (SmartConnect) Prerequisite|'''authenticated access''']], you will need to create a new user with the Web Service Client Access attribute.
# Create the new user and set access to Web Service Client Access.
For public access there is no requirement to create a user.
==Accessing a Report with OData ServiceReport with OData==SmartSimple OData services support requests for data via HTTP GET request. Private and Public Endpoints listed above will enumerate exposes all collections of entities (Reports enabled by OData Connector).
Syntax below is an example to view OData records from a report named '''my_Neo_Report''' 
<pre>http://mysmartsimpleurl/OData/V2/pub/424623/Service.svc/my_Neo_Report_records<br />http://mysmartsimpleurl/OData/V3/pub/424623/Service.svc/my_Neo_Report_records<br />
http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/my_Neo_Report_records</pre>
The webpage output ==OData Primitive Data Types==Primitive type representations in XML request is based on the [[Custom Field Type IDs|Data Type]] of the [[Standard Field|Standard Fields]] / [[Custom Fields – General Information|Custom Fields]]<br />Column headers from a report with the following data types will display maximum of 1024 rows only..not be successfully transformed in the OData Service Report: * Display Only* Link* Read Only* Store Values
==Syntax of OData Queries==
1. Service Metadata Document - describes the data model exposed as HTTP endpoints by the service. <pre>http://mysmartsimpleurl/OData/V2/pub/424623/Service.svc/$metadata</pre> 2. Search syntax i.e. criteria on report using “???”: the URL below returns OData records with firstname equal ‘steve’ only
<pre>http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records?$search=steve</pre>
23. Filter for dynamical search: the URL below returns OData records with firstname equal ‘steve’ only (eq stands for equal in OData protocol)
<pre>http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records?$filter=first_name +eq+steve </pre>
34. Ordering: the URL below orders by first name
<pre>http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records?$orderby=first_name+asc
</pre>
45. $top and $skip, used mainly for pagination: The syntax below skips 3 records and return 2 records only (i.e. only 4th and 5th will return)
<pre> http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records?$top=2&$skip=3</pre>
 
6. $count, used to determine how many rows in a collection
 
<pre> http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records/$count</pre>
 
==Consuming SmartSimple OData Feed==
The following examples show how to consume OData.
 
* [[SmartSimple_OData_Feed_to_Excel|Pulling OData feed to Excel]]
* [[SmartSimple_OData_Feed_to_SQL_Server_Database|Import OData feed to SQL Server Database using SQL Server Integration Services]]
==Troubleshooting==
* Report name '''must not''' contain special characters such as question marks, underscore, number sign. Some characters, such as hyphens, are supported.
* Column Headings '''must not''' contain special characters such as question marks, number sign or brackets. Some characters, such as hyphens, are supported.
* Some applications, such as older versions of MS Excel / .NET , may not support the appropriate level of TLS Encryption (i.e. https) required.
=See Also=
* [[Reports: SmartSimple Reports]]* [[OData Connector]]* [http://www.odata.org More information on OData] [[Category:Integration]][[Category:API]]
Smartstaff
1,385
edits

Navigation menu