Changes

Jump to: navigation, search

Odata Overview

1,945 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 for the (Reports that are OData enabled).Enable [https://wiki.smartsimple.com/wiki/OData_Connector OData serviceConnector] to use these endpoints.
===Private Access Endpoint===
A private endpoint will need basic authentication for '''authenticated access''' user to access the collection of entities.<br />Version 4: https: //mysmartsimpleurl/OData/'''V4'''/'''pri'''/424623/Service.svc/<br />Version 3: https: //mysmartsimpleurl/OData/'''V3'''/'''pri'''/424623/Service.svc/<br />
Version 2: https: //mysmartsimpleurl/OData/'''V2'''/'''pri'''/424623/Service.svc/
===Public Access Endpoint===
If you wish data to be exposed publicly without basic authentication. Note the underlying report must be Internet and OData enabled.<br />
Version 4: https: //mysmartsimpleurl/OData/'''V4'''/'''pub'''/424623/Service.svc/<br />
Version 3: https: //mysmartsimpleurl/OData/'''V3'''/'''pub'''/424623/Service.svc/<br />
Version 2: https: //mysmartsimpleurl/OData/'''V2'''/'''pub'''/424623/Service.svc/
===Public Access Endpoint=How to setup an authenticated user to consume a private OData Service==If For [[JSON API (SmartConnect) Prerequisite|'''authenticated access''']], you wish data will need to be exposed publicly without basic authentication. Note the underlying report must be Internet and OData enabledcreate a new user with the API Access attribute.
Version 4: https: //mysmartsimpleurl/OData/'''V4'''/'''Pub'''/424623/Service# Create the new user and set access to API Access.# Set a password for this user.svc/
Version 3: https: //mysmartsimpleurl/OData/'''V3'''/'''Pub'''/424623/ServiceFor public access there is no requirement to create a user.svc/
Version 2: https: //mysmartsimpleurl/==Accessing a Report with OData/'''V2'''/'''Pub'''/424623/Service==SmartSimple OData support requests for data via HTTP GET request.Private and Public Endpoints exposes all collections (Reports enabled by OData Connector).svc/
==How Syntax below is an example to setup view OData records from within SmartSimple==For a report named '''authenticated accessmy_Neo_Report''', you will need to create a new user with the Web Service Client Access attribute. 
# Create the new user and set access to Web <pre>http://mysmartsimpleurl/OData/V2/pub/424623/Service Client Access.svc/my_Neo_Report_recordshttp://mysmartsimpleurl/OData/V3/pub/424623/Service.svc/my_Neo_Report_recordshttp://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/my_Neo_Report_records</pre>
# Set ==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 password for this user.report with the following data types will not be successfully transformed in the OData Service Report:
For public access there is no requirement to create a user.* Display Only* Link* Read Only* Store Values
==Modifying a Report for Use with Syntax of ODataQueries==# Edit 1. Service Metadata Document - describes the Report in Neo Report Builder# Enable the OData checkbox on the Advanced tab# Enable the Internet Enabled checkbox '''if you wish data model exposed as HTTP endpoints by the data to be publicservice.
<pre>http://mysmartsimpleurl/OData/V2/pub/424623/Service.svc/$metadata</pre>
==Syntax==12. Search syntax i.e. criteria on report using “???”: the URL below returns OData records with firstname equal ‘steve’ only
<pre>http://localhostmysmartsimpleurl/OData/V4/pub/113424623/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://localhostmysmartsimpleurl/OData/V4/pub/113424623/Service.svc/report_Neo_records?$filter=first_name +eq+steve </pre>
34. Ordering: the URL below orders by first name
<pre>http://localhostmysmartsimpleurl/OData/V4/pub/113424623/Service.svc/report_Neo_records?$orderby=first_name+asc
or
http://localhostmysmartsimpleurl/OData/V4/pub/113424623/Service.svc/report_Neo_records?$orderby=first_name
</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