Changes

Jump to: navigation, search

Odata Overview

1,255 bytes added, 8 April
m
How to setup an authenticated user to consume a private OData Service
==OData Services Endpoints==
SmartSimple OData provides two endpoints (Service Root URL): 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 Connector] 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 the API Access attribute.
# Create the new user and set access to Web Service Client to API Access.
# Set a password for this user.
For public access there is no requirement to create a user.
==Modifying Accessing a Report for Use with OData==# Edit the Report in Neo Report BuilderSmartSimple OData support requests for data via HTTP GET request.# Enable the Private and Public Endpoints exposes all collections (Reports enabled by OData Connector checkbox on the Advanced tab# Enable the Internet Enabled checkbox '''if you wish the data to be public).
==Accessing Syntax below is an example to view OData records from a Report with OData Service==report named '''my_Neo_Report''' OData services support requests for data via HTTP GET request. Endpoints listed above will enumerate all collections of entities (Reports enabled by OData Connector).<pre>http://mysmartsimpleurl/OData/V2/pub/424623/Service.svc/'''my_Neo_Reports'''_records<br />my_Neo_Report_recordshttp://mysmartsimpleurl/OData/V3/pub/424623/Service.svc/'''my_Neo_Reports'''_records<br />my_Neo_Report_recordshttp://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/'''my_Neo_Reports'''_recordsmy_Neo_Report_records<br /pre==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 /pre>Column headers from a report with the following data types will 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
281
edits

Navigation menu