PUBLIC
2021-03-09
OData Services
THE BEST RUN
Content
- 1
- SAP Cloud for Customer OData API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
- 2
- New Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
What's New in OData API v2 Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Add Public Solution Model (PSM) Fields to Standard OData Services. . . . . . . . . . . . . . . . . . . . . . . . 15 Transport Custom OData Services with Transport Management. . . . . . . . . . . . . . . . . . . . . . . . . . . .16 Compatibility Mode for READ Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Support for User-Friendly IDs in Standard OData Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 Constant Values to Function Imports. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
2.1 2.2 2.3 2.4 2.5 2.6
- 3
- OData API Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18
OData API v2 Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18 OData API v1 Reference (Deprecated). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
Account Contact Relationship. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Account EntityType. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Appointment Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 BusinessPartner Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 CodeList Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Contextual CodeList Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Contact Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 EMail Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Employee Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 External ID Mapping Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Individual Customer Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Lead Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Sales Lead Entity Type (Deprecated). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Opportunity Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118 Phone Call Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138 Product Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 Service Request Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Task Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 TimeEntry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 User Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Visit Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 Marketing Attributes Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 HTTP Status Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Service Assignment Entity Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
3.1 3.2
OData Services
- Content
- 2
PUBLIC
- 4
- OData Service Explorer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Creating an OData Service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203 Testing an OData Service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .209
4.1 4.2
567
OData API Monitor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 (Deprecated) Setting Up OData Notifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 SAP Cloud for Customer OData Developer's Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .220
- Additional Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
- 8
OData Services
Content
PUBLIC
3
1 SAP Cloud for Customer OData API
The SAP Cloud for Customer OData API conforms to OData version 2 specification. The complete list of collections (or data end-points) of SAP Cloud for Customer OData API, are listed in the OData API Reference section of this document.
Related Information
OData Version 2.0 Specification SAP Cloud for Customer OData API 2.0 Reference
- 1.1
- Purpose
Use the OData API, to query, read, add, update and delete data from and into SAP Cloud for Customer. This document is a reference point for learning SAP Cloud for Customer OData API. You'll find a short introduction to the capabilities of the OData API as well as information on where to find more details.
1.2 What is OData?
OData (Open Data Protocol) is an OASIS Standard that defines a protocol for building and consuming RESTful APIs, based on the HTTP protocol.
OData differentiates itself from most of the other RESTful APIs, mainly by providing the following:
●●●
Metadata of the entities exposed by the OData service Relationship between the entities within an OData service System and custom query options for retrieving data
The protocol allows filtering data, ordering and paginating of the query results, retrieving number of records, and more. Querying and modifying data is possible in XML (AtomPub) and JSON formats.
For more information on OData protocol, please visit to http://www.odata.org, where you can find different versions of OData specifications, community resources (such as OData providers and consumer libraries), sample OData services and tutorials.
OData Services
- SAP Cloud for Customer OData API
- 4
PUBLIC
Related Information
https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=odata http://www.odata.org/
1.3 Accessing OData API
You can access the SAP Cloud for Customer OData API of your tenant, with the URL pattern: https:// <your_tenant>/sap/c4c/odata/v1/c4codataapi
1.4 Accessing Metadata of the OData API
You can access the metadata of the OData API of your tenant, with the URL pattern: https:// <YourTenant>/sap/c4c/odata/v1/c4codataapi/$metadata
1.5 Authentication
Learn about security options for accessing the SAP Cloud for Customer OData API. Client applications using the OData API, have four options for providing authorization and authentication for their users:
●●●●
Basic Authentication OAuth 2.0 X.509 SAML (Security Assertion Markup Language) based single sign-on.
Using OAuth 2.0 requires a trust relationship to be configured between SAP Cloud for Customer and the identity provider of your client application in the Administrator work center.
See Create Trust Between the Customer Account and SAP Cloud for Customer.
OData Services
SAP Cloud for Customer OData API
PUBLIC
5
1.6 Authorization
Authorization of a business user in the user interface is usually the same as the authorization in OData Services. However, there are some exceptions to this behavior.
Exceptions to Authorization Behavior
See the following table to learn about the exceptions.
Behavior in User Interface
- Use Case
- Description
- (UI)
- Behavior in OData Service
Work center view is visible without data restriction.
OData service with work center view assigned has full access to all data and operations.
Restriction at Work Center View
Work center view is assigned with no restrictions in the Administrator work center.
Access Restriction at Instance
- Work center view is assigned Work center view is visible,
- OData honors RBAM restric-
- with Read and Write restric-
- and data visibility is re-
stricted as configured in user access management. tion and limits the access. tion.
Example: Only opportunities
with sales territory 17 are available. Create/Update/ Delete is restricted for opportunities with sales territory 17.
Example: Opportunity with sales territory 17 is restricted Example: User can see op(both Read and Write) for the portunities with sales terri-
- user.
- tory 17 only.
Restrictions in Field
- You can use business roles to The object work list (OWL)
- OData doesn’t honor field re-
striction and field is visible in response. restrict (Hide/ReadOnly/ UnRestricted) the fields (standard and extension) from the work center views added to business role. doesn’t hide the restricted (hidden) field, but data isn’t displayed.
Thing Inspector UI hides the restricted field.
Example:
ExpectedRevenueAmou
tfield in an opportunity is hidden.
Action Restriction
You can use business roles to UI restricts user from execut- Restriction isn’t honored. It’s
- restrict business object ac-
- ing the action.
- possible to execute the re-
- tions.
- stricted function import.
Example: The action Won in Opportunity is restricted for the business role.
- UI honors KUT adaptations
- KUT adaptations aren’t hon-
ored.
SAP Key User Tool (KUT) Adaptations
KUT fields with business logic.
Example: KUT field’s visibility based on business role.
OData Services
- SAP Cloud for Customer OData API
- 6
PUBLIC
Behavior in User Interface
- (UI)
- Use Case
- Description
- Behavior in OData Service
UI Switches
UI switches are defined by custom development and can be used to make fields, buttons, or sections of user interfaces hidden, read-only, or mandatory. You can use them to assign a particular version of a UI to a business role and to its affected users.
- UI switches are honored as
- UI Switches aren’t honored.
configured.
Data encapsulated within section groups that is hidden via UI switch is available in OData response.
Example: A UI section group is read-only. And another one is hidden.
Enhancements to Authorization Assignment
Authorization assignments for several OData services are enhanced. With this enhancement, users require the necessary authorizations to consume these OData services.
In previous releases, your users may have been able to consume the impacted OData services without the necessary authorization assignments. For those users, this is an incompatible change. As of the August 2020 release, you must assign the work center view assignments as listed in the table for these users.
Here is a list of impacted services:
Authorization As-
Data Workbench Relevant Service signment
OData
Service Name
Entity Type
Entity Type UI Text (La- (Assign at
- Name
- bel)
- least one.)
prcconver- CodPrcsionfactors Conversion- sion Factors
- Prc Conver-
- Yes
COD_QUOT E_WCVIEW
Factors
COD_SALE SORDER_W CVIEW
- prccurren- CodPrcCur- Prc Cur-
- Yes
COD_QUOT E_WCVIEW
- cycode-
- rencyCode- rency Code
- Names Names
- names
COD_SALE SORDER_W CVIEW
OData Services
SAP Cloud for Customer OData API
PUBLIC
7
Authorization As-
Data Workbench Relevant Service signment
OData
Service Name
Entity Type
Entity Type UI Text (La- (Assign at
- Name
- bel)
- least one.)
- prccurren- CodPrcCur- Prc Cur-
- Yes
Yes Yes Yes Yes Yes
COD_QUOT E_WCVIEW
- cycodes
- rencyCodes rency Co-
des
COD_SALE SORDER_W CVIEW
- prccurren- CodPrc-
- Prc Cur-
COD_QUOT E_WCVIEW
cydecplaces
CurrDecPlaces rency Decimal Places
COD_SALE SORDER_W CVIEW
- prccurre-
- CodPrcE-
- Prc Ewu-
COD_QUOT E_WCVIEW
- wukeys
- wukeys
- keys
COD_SALE SORDER_W CVIEW
prcexchangerates
CodPrcEx- Prc Ex-
COD_QUOT E_WCVIEW
- changeR-
- change
- Rates
- ates
COD_SALE SORDER_W CVIEW
prcexchan- CodPrcEx- Prc Exgeratetypes changeRa- change
COD_QUOT E_WCVIEW
- teTypes
- Rate Types
COD_SALE SORDER_W CVIEW
prcexpiring- CodPrcExp- Prc Expiring
COD_QUOT E_WCVIEW
- currencies Curr
- Currency
COD_SALE SORDER_W CVIEW
OData Services
- SAP Cloud for Customer OData API
- 8
PUBLIC
Authorization As-
Data Workbench Relevant Service signment
OData
Service Name
Entity Type
Entity Type UI Text (La- (Assign at
- Name
- bel)
- least one.)
prcobjtypeexpcurr
CodPrcObj- Prc Obj TypExpCurr Type for
Exp Cur-
Yes Yes Yes Yes
COD_QUOT E_WCVIEW
rency
COD_SALE SORDER_W CVIEW
prcquota-
tionprefix
- CodPrc-
- Prc Quota-
COD_QUOT E_WCVIEW
Quotation- tion Prefix
Prefix
COD_SALE SORDER_W CVIEW
prcquotations
- CodPrc-
- Prc Quota-
COD_QUOT E_WCVIEW
Quotations tions
COD_SALE SORDER_W CVIEW
- prcwarn-
- CodPrcWar- Prc Warning
COD_QUOT E_WCVIEW
perexpcurr PerExpCurr Period for
Exp Currency
COD_SALE SORDER_W CVIEW
- socialme-
- SocialMe-
- Social Me- SEOD_SMA Yes
- diaactivity
- diaActivity
- dia Activity
_SADL_WC VIEW