lumc developer en
TRANSCRIPT
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 1/28
SAP Lumira CloudDocument Version: 1.23 – 2015-03-03
SAP Lumira Cloud Developer Guide
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 2/28
Content
1 About the SAP Lumira ® Cloud API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Authentication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 To get an access token. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Retrieving items in SAP Lumira Cloud. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1 Get list of items. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Item properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Embeddable links. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.1 To view a story. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5 Creating and managing groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1 Get groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 Create group or subgroup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.3 Update group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.4 Delete group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.5 Add member to group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.6 Delete member from group. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.7 Ge t group members. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.8 Ge t groups a team member belongs to. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Content
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 3/28
1 About the SAP Lumira ® Cloud API
This guide is designed to help you build applications using SAP Lumira Cloud content. It includes examples andprogramming references that you can use to implement the SAP Lumira Cloud API.
The SAP Lumira Cloud API allows content stored in SAP Lumira Cloud to be consumed and embedded in mobiledevices and web-enabled technology. With the SAP Lumira Cloud API, you can do the following:
● Retrieve content using Open Data Protocol (OData) with OAuth 2.0.● View SAP Lumira Cloud stories.● Create and manage groups.
Note
It is assumed that multitenancy has been set up, and all configuration steps have been completed on the SAPHANA Cloud Platform.
Additional Information
For more information see:
● SAP Lumira Cloud User Guide● SAP Lumira Cloud Release Notes
SAP Lumira Cloud Developer GuideAbout the SAP Lumira ® Cloud API © 2015 SAP SE or an SAP affiliate company. All rights reserved. 3
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 4/28
2 Authentication
To access SAP Lumira Cloud using the Open Data Protocol (OData), you need an access token.
To get an access token, you must make a request to the SAP HANA HANA Cloud Platform authorization service.The token proves you have been authenticated as a valid user, and it can be included with subsequent ODatarequests without exposing sensitive information such as your password.
Each time you make a request to the OData service, you must add an access token to the request header.
2.1 To get an access token
Before you can access items in SAP Lumira Cloud with the OData protocol, you must get an access token.
Prerequisites
A client must be set up for you in the SAP HANA Cloud Platform Cockpit. You will need the client ID, and theredirect URI. For more information see Configuring OAuth Authorizations .
Procedure
1. Get a callback token from the SAP HANA OAuth service using the following URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/oauth2/api/v1/authorize?response_type=code&client_id=<ID>&redirect_uri=<URI>k&scope=OdataItemQueryService
The following parameters must be included in the request:○ response_type=code○ client_id=<ID>○ redirect_uri=<URI>○ scope=OdataItemQueryService
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to, <ID> with yourclient ID, and <URI> with the redirect URI.
A callback token is returned to the redirect URI specified.
4 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Authentication
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 5/28
2. Use the POST method to send a request to the following URL.
https://oauthasservices-<tenant_name>.hana.ondemand.com/oauth2/api/v1/token
Example request:○ Method: POST○ URL: https://oauthasservices-<TENANT>.hana.ondemand.com/oauth2/api/v1/token○ Request body:
grant_type=authorization_code code=<CALLBACKTOKEN>client_id=<ID> redirect_uri=<URI>
○ Content type: application/x-www-form-urlencoded
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to. Replace
<CALLBACKTOKEN> with the token returned in step 1, <ID> with your client ID, and <URI> with the redirectURI.
Example response:
{ access_token : "edb51cf2d62dec7ef1ef7a542aa355b3" token_type: "Bearer" expires_in: 600 refresh_token: "9bbda5acfe629edb838cf537596ae0"
scopes: [1] 0: "OdataItemQueryService" }
Note
If client authentication is not configured, you may be asked to log in before the access token is granted. Forinformation on configuring client authentication, for example setting up SAML SSO authentication, see IDFederation with the Corporate Identity Provider .
Results
An access token is returned. The access token must be used each time you make a request to the OData service.
SAP Lumira Cloud Developer GuideAuthentication © 2015 SAP SE or an SAP affiliate company. All rights reserved. 5
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 6/28
3 Retrieving items in SAP Lumira Cloud
Items in SAP Lumira Cloud can be retrieved and viewed using the API.
The /v3/Items endpoint exposes all of the items that are accessible to the user currently logged into SAP LumiraCloud. This includes items that the user has created, and items that are shared by another user.
Note
You must have a valid access token.
Related Information
To get an access token [page 4]
3.1 Get list of items
GET /v3/Items
● Description: Returns a list all of the items that are accessible to the current user. This includes items that theuser has created, and items that are shared by another user.
● Operation: GET● URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/v3/Items?$format=<FORMAT>
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to.
● Optional Parameters: format=<FORMAT> .
Note
Replace <FORMAT> with xml or json. By default, the OData service returns data in XML format, if the
format parameter is unspecified.
● Header: Authorization=Bearer <ACCESSTOKEN>
6 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Retrieving items in SAP Lumira Cloud
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 7/28
Note
Replace <ACCESSTOKEN> with your access token. By default, the OData service returns data in XML
format, if the format parameter is unspecified.
Example Response
200 OK
JSON:
{
"d": { "results": [ { __metadata: { uri: "https://localhost:8080/v3/Items(userId='25bdc1f2-64f1-414a-bc39-765d779ff9f4',Uuid='53DB9FDFFDCA0E6FE10000000A443156')" type: "testnightly.v3odatacalc.v3.ItemsType" }- userId: "25bdc1f2-64f1-414a-bc39-765d779ff9f4" Uuid: "53DB9FDYYDCA0E6FE10000000A443156" Name: "Story Name" ItemType: "sap.lumira.story.type" CreatedAt: "/Date(1406932368347)/" UpdatedAt: "/Date(1407861082528)/" Description: "Story Description" PackageName: null ViewName: null OwnerUuid: "86b5a4bf-4751-4ad3-bd96-574df0e3ad52" OwnerName: "Nivedan Bamal" OwnerIsMe: 0 LastModifierUuid: "4bf3f69b-5b00-49ea-b8cf-638b917ef261" LastModifierName: "[IRI] Shadow of the Fulmination" LastModifierIsMe: 0 IsAppItem: 1 IsShared: 1 Permission: "READ" IsPublishedFromDesktop: 0 CurrentUserUuid: "16bdc1f2-64f1-414a-bc39-765d779ff9f4" Shares: { __deferred: { uri: "https://localhost:8080/v3/Items(userId='25bdc1f2-64f1-414a-
bc39-765d779ff9f4',Uuid='53DB9FDFFDCA0E6FE10000000A443156')/Shares" }- }- }
XML:
<feed xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns="http://www.w3.org/2005/Atom" xml:base="https://<tenant_name>.hana.ondemand.com/v3/"> <title type="text">Results</title> <id>https://localhost:8080/v3/Results</id> <author> <name />
</author> <link rel="self" title="Results" href="Results" />
SAP Lumira Cloud Developer GuideRetrieving items in SAP Lumira Cloud © 2015 SAP SE or an SAP affiliate company. All rights reserved. 7
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 8/28
<entry> <id>https://localhost:8080/v3/Items(userId='25bdc1f2-64f1-414a-bc39-765d779ff9f4',Uuid='53DB9FDYYDCA0E6FE10000000A443156')</id> <title type="text" />
<author> <name /> </author> <link rel="edit" title="Items" href="Items(userId='25bdc1f2-64f1-414a-bc39-765d779ff9f4',Uuid='53DB9FDFFDCA0E6FE10000000A443156')" /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Shares" type="application/atom+xml;type=feed" title="Shares"href="Items(userId='25bdc1f2-64f1-414a-bc39-765d779ff9f4',Uuid='53DB9FDFFDCA0E6FE10000000A443156')/Shares" /> <category term="testnightly.v3odatacalc.v3.ItemsType" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:userId m:type="Edm.String">16bdc1f2-64f1-414a-bc39-765d779ff9f4</d:userId> <d:Uuid m:type="Ed m.String">53DB9FDYYDCA0E6FE10000000A443156</d:Uuid> <d:Name m:type="Edm.String">Story Name</d:Name> <d:ItemType m:type="Edm .String">sap.lumira.story.type</d:ItemType> <d:CreatedAt m:type="Edm.DateTime">2014-08-01T22:32:48.3470000</d:CreatedAt> <d:UpdatedAt m:type="Edm.DateTime">2014-08-12T16:31:22.5280000</d:UpdatedAt> <d:Description m:type="Edm.String">Story Description</d:Description> <d:PackageName m:type="Edm.String" m:null="true" /> <d:ViewName m:type="Edm.String" m:null="true" /> <d:OwnerUuid m:type="Edm.String">86b5a4bf-4751-4ad3-bd96-574df0e3ad52</d:OwnerUuid> <d:OwnerName m:type="Edm.String">Nivedan Bamal</d:OwnerName> <d:OwnerIsMe m:type="Edm.Byte">0</d:OwnerIsMe> <d:LastModifierUuid m:type="Edm.String">4bf3f69b-5b00-49ea-b8cf-638b917ef261</d:LastModifierUuid> <d:LastModifierName m:type="Edm.String">[IRI] Shadow of the Fulmination</d:LastModifierName> <d:LastModifierIsMe m:type="Edm.Byte">0</d:LastModifierIsMe> <d:IsAppItem m:type="Edm.Byte">1</d:IsAppItem> <d:IsShared m:type="Edm.Byte">1</d:IsShared> <d:Permission m:type="Edm.String">READ</d:Permission> <d:IsPublishedFromDesktop m:type="Edm.Byte">0</d:IsPublishedFromDesktop> <d:CurrentUserUuid m:type="Edm.String">25bdc1f2-64f1-414a-bc39-765d779ff9f4</d:CurrentUserUuid> </m:properties> </content> </entry></feed> </entry>
Related Information
To get an access token [page 4]
Item properties [page 9]
8 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Retrieving items in SAP Lumira Cloud
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 9/28
3.2 Item properties
The /v3/Items endpoint exposes all of the items that are accessible to the user currently logged into SAP LumiraCloud.
/v3/Items
Each item returned by the OData protocol contains the following information:
Property Type escription
Uuid Edm.String Primary Key The UUID of the item.
Name Edm. String The name of the item.
ItemType Edm. String The type of the item:
● sap.lumira.dataset.type● sap.lumira.story.type● sap.lumira.document.type
CreatedAt Edm.DateTime The UTC time at which the item iscreated.
UpdatedAt Edm.DateTime The UTC time at which the item isupdated.
Description Edm.String The description associated with thisitem.
OwnerUuid Edm.String The unique identifier for the owner ofthis item. In SAP Lumira Cloud, this isthe owner's username.
OwnerName Edm.String The name of the owner of this item. InSAP Lumira Cloud, this is the owner'sfull name.
OwnerIsMe Edm.Byte 1, if the current user owns this item. 0, if
not.LastModifierUuid Edm.String The unique identifier for the user who
last modified this item. In SAP LumiraCloud, this is the modifier's username.
LastModifierName Edm.String The name of the user who last modifiedthis item. In SAP Lumira Cloud, this isthe last modifier's full name.
LastModifierIsMe Edm.Byte 1, if the current user is the user who lastmodified this item. 0, if not.
IsShared Edm.Byte 1, if this item is shared with at least oneSAP Lumira Cloud user. 0, if not.
SAP Lumira Cloud Developer GuideRetrieving items in SAP Lumira Cloud © 2015 SAP SE or an SAP affiliate company. All rights reserved. 9
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 10/28
Property Type escription
Permission Edm.String WRITE, if the current user has the rights
to edit (but not delete) the current item.READ, if the current user does not haveedit rights.
IsPublishedFromDesktop Edm.Byte 1, if this item was published from SAPLumira Desktop. 0, if not.
CurrentUserUuid Edm.String The UUID of current SAP Lumira Cloudsession user.
/Shares Expandable Property Contains information on which usersthe current item is shared with, whocreated the share entry, and the editrights of the current user.
10 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Retrieving items in SAP Lumira Cloud
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 11/28
4 Embeddable links
Stories can be added to your web applications using an embeddable link.
An embeddable link follows the following format:
https://<TENANT>.hana.ondemand.com/open?id=<UUID>
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to. Replace <UUID>with the UUID of a story. The UUID of a story can be retrieved using the OData protocol. The URL is casesensitive.
Optional parameters Value escription
titlebar true or false If true is selected, the title bar isdisplayed. If false is selected, the titlebar is hidden. By default, false isselected.
Note
Editing or saving a story is notpossible if the title bar is hidden.
edit true , false If true is selected, the Edit buttonappears and modifications to the storycan be saved. If false is selected, thesave button is hidden. By default,false is selected.
Note
This parameter is only applicable ifthe title bar is displayed.
mode view , explore ● view : Displays the Chart Canvas .By default, view is selected.
● explore : Displays the fullVisualize and Compose rooms.
type sap.lumira.story.type Opens a story.
Note
Only stories are supported. A blankpage will appear if the item specifiedis not a story.
SAP Lumira Cloud Developer GuideEmbeddable links © 2015 SAP SE or an SAP affiliate company. All rights reserved. 11
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 12/28
Note
All parameters are optional, except for ID . A blank page will be returned if no ID is specified or the ID is invalid. If
the current user is assigned view only rights to a shared story, the save button does not appear.
4.1 To view a story
You can use a URL to view a story once you know it's UUID.
Prerequisites
You must have the UUID of the story you want to view. For more information see Get list of items [page 6]
SAML SSO is reccomended. If SSO is not enabled, users will be prompted to log in before a story can be viewed.For more information on SSO, see ID Federation with the Corporate Identity Provider .
Procedure
View a story using the following URL:
https://<TENANT>.hana.ondemand.com/open?id=<UUID>&type=sap.lumira.story.type&mode=view
Optional parameters:○ type=sap.lumira.story.type○ mode=view
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to. Replace <UUID>with the UUID of the story. The URL is case sensitive.
Results
The requested story appears.
12 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Embeddable links
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 13/28
5 Creating and managing groups
Groups can be created and managed using the API.
The /v3/Groups endpoint exposes all the groups that belong to the user currently logged into SAP Lumira Cloud.the /v3/GroupMembers endpoint exponses all members that belong to a group.
Note
You must have a valid access token.
Related Information
To get an access token [page 4]
5.1 Get groups
GET /v3/Groups
● Description: Returns a list of groups the user belongs to. If the current user is a team administrator, all groupsbelonging to the team will also be returned.
● Operation: GET● URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/v3/Groups
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to.
● Parameters: None.
Example Response
200 OK
JSON:
{
SAP Lumira Cloud Developer GuideCreating and managing groups © 2015 SAP SE or an SAP affiliate company. All rights reserved. 13
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 14/28
"d": { "results": [{ "__metadata": { "uri": "http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-
a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')", "type": "testvin.v3odatacalc.v3.GroupsType" }, "userId": "f8344476-6fa5-409c-a1d9-0b2fb69cd39b", "Uuid": "54294DB47F631444E10000000AA0D394", "Name": "a", "ParentUuid": "", "CurrentMembershipCount" : 1, "ExplicitMember": 0, "ImplicitMember": 1, "CurrentUserUuid": "f8344476-6fa5-409c-a1d9-0b2fb69cd39b", "Members": { "__deferred": { "uri": "http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')/Members" } } }, { "__metadata": { "uri": "http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')", "type": "testvin.v3odatacalc.v3.GroupsType" }, "userId": "f8344476-6fa5-409c-a1d9-0b2fb69cd39b", "Uuid": "54294DB77F631444E10000000AA0D394", "Name": "b", "ParentUuid": "54294DB47F631444E10000000AA0D394", "CurrentMembershipCount" : 1, "ExplicitMember": 1, "ImplicitMember": 0, "CurrentUserUuid": "f8344476-6fa5-409c-a1d9-0b2fb69cd39b", "Members": { "__deferred": { "uri": "http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')/Members" } } }] }}
XML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <feed xml:base="http://localhost:8080/v3/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"xmlns="http://www.w3.org/2005/Atom"> <title type="text">Results</title> <id>http://localhost:8080/v3/Results</id> <author> <name /> </author> <link rel="self" title="Results" href="Results" /> <entry> <id>http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')</id> <title type="text"/> <author> <name /> </author> <link rel="edit" title="Groups"
14 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Creating and managing groups
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 15/28
href="Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')"/> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Members" type="application/atom+xml;type=feed" title="Members"
href="Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')/Members"/> <category term="testvin.v3odatacalc.v3.GroupsType" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:userId m:type="Edm.String">f8344476-6fa5-409c-a1d9-0b2fb69cd39b</d:userId> <d:Uuid m:type="Edm.String">54294DB47F631444E10000000AA0D394</d:Uuid> <d:Name m:type="Edm.String">a</d:Name> <d:ParentUuid m:type="Edm.String"/> <d:CurrentMembershipCount m:type="Edm.Byte">1</d:CurrentMembershipCount> <d:ExplicitMember m:type="Edm.Byte">0</d:ExplicitMember> <d:ImplicitMember m:type="Edm.Byte">1</d:ImplicitMember> <d:CurrentUserUuid m:type="Edm.String">f8344476-6fa5-409c-a1d9-0b2fb69cd39b</d:CurrentUserUuid> </m:properties> </content> </entry> <entry> <id>http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')</id> <title type="text"/> <author> <name /> </author> <link rel="edit" title="Groups" href="Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')"/> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Members" type="application/atom+xml;type=feed" title="Members" href="Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')/Members"/> <category term="testvin.v3odatacalc.v3.GroupsType" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:userId m:type="Edm.String">f8344476-6fa5-409c-a1d9-0b2fb69cd39b</d:userId> <d:Uuid m:type="Edm.String">54294DB77F631444E10000000AA0D394</d:Uuid> <d:Name m:type="Edm.String">b</d:Name> <d:ParentUuid m:type="Edm.String">54294DB47F631444E10000000AA0D394</d:ParentUuid> <d:CurrentMembershipCount m:type="Edm.Byte">1</d:CurrentMembershipCount> <d:ExplicitMember m:type="Edm.Byte">1</d:ExplicitMember> <d:ImplicitMember m:type="Edm.Byte">0</d:ImplicitMember> <d:CurrentUserUuid m:type="Edm.String">f8344476-6fa5-409c-
a1d9-0b2fb69cd39b</d:CurrentUserUuid> </m:properties> </content> </entry> </feed>
SAP Lumira Cloud Developer GuideCreating and managing groups © 2015 SAP SE or an SAP affiliate company. All rights reserved. 15
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 16/28
5.2 Create group or subgroup
POST /v3/Groups
● Description: Creates a group or subgroup.● Operation: POST● URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/v3/Groups
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to.
Parameters
The following parameters must be included in the request body:
Parameter escription
Name The name of the group to be created. The name be unique tothe team or parent group if the new group is a subgroup.
ParentUuid The UUID of the parent group if the new group is a subgroup;otherwise enter an empty string ("") .
Content-Type The format of the request header and response.
● JSON: application/json;charset=utf-8● XML: application/atom+xml;charset=utf-8
Example Response
200 OK
JSON:
{ "d": { "__metadata": { "uri": "http://localhost:8080/v3/Groups('5418BD7D4A341783E10000000AA0D394')", "type": "testci.v3odatagroup.v3.GroupsType" }, "Uuid": "5418BD7D4A341783E10000000AA0D394", "Name": "Group Created Via JSON", "TeamUuid": "2f365a29-8449-4fed-9ea4-3bc2e68c612a",
"ParentUuid": "" }
16 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Creating and managing groups
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 17/28
}
XML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <entry xml:base="http://10.160.216.86:8000/testci/v3odatagroup/v3.xsodata/"xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"xmlns="http://www.w3.org/2005/Atom">
<id>http://localhost:8080/v3/Groups('5418BD744A341783E10000000AA0D394')</id> <title type="text"></title> <author> <name /> </author> <link rel="edit" title="Groups"href="Groups('5418BD744A341783E10000000AA0D394')"/> <category term="testci.v3odatagroup.v3.GroupsType" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml">
<m:properties> <d:Uuid m:type="Edm.String">5418BD744A341783E10000000AA0D394</d:Uuid> <d:Name m:type="Edm.String">Group Created Via XML</d:Name> <d:TeamUuid m:type="Edm.String">2f365a29-8449-4fed-9ea4-3bc2e68c612a</d:TeamUuid> <d:ParentUuid m:type="Edm.String"></d:ParentUuid> </m:properties> </content></entry>
Errors
● 400 Invalid parameter: Name must be non-empty and contain less than 256 characters● 401 User does not have the rights to perform this action. Only the team administrator or group owner can
delete a group.● 404 Group or team not found.
5.3 Update group
PUT /v3/Groups('<GROUP_ID>')
● Description: Update the name of the group or move it.
Note
A group containing one or more subgroups cannot be deleted.
● Operation: PUT● URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/v3/Groups('<GROUP_ID>')
SAP Lumira Cloud Developer GuideCreating and managing groups © 2015 SAP SE or an SAP affiliate company. All rights reserved. 17
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 18/28
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to. Replace
<GROUP_ID> with the UUID of the group to update.
Parameters
The following parameters must be included in the request body:
Parameter escription
Name The name of the group to be created. The name be unique tothe team or parent group if the new group is a subgroup.
ParentUuid The UUID of the parent group if the new group is a subgroup;otherwise enter an empty string ("") .
Content-Type The format of the request header and response.
● JSON: application/json;charset=utf-8● XML: application/atom+xml;charset=utf-8
Response
204 No Content
Errors
● 400 Invalid parameters: Name must be non-empty and contain less than 256 characters. Name must unique
within a team (for groups) or with a group (for subgroups). Invalid move.● 401 User does not have the rights to perform this action. Only the team administrator or group owner can
delete a group.● 404 Group or team not found.● 500 Other errors.
Related Information
Get groups [page 13]
18 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Creating and managing groups
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 19/28
5.4 Delete group
DELETE /v3/Groups('<GROUP_ID>')
● Description: Delete a group and remove all members from the group.
Note
A group containing one or more subgroups cannot be deleted.
● Operation: DELETE● URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/v3/Groups('<GROUP_ID>')
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to. Replace
<GROUP_ID> with the UUID of the group to delete.
● Parameters: None.● Response: 204 No Content .
Errors
● 400 Invalid parameters. Group cannot be deleted, because it contains subgroups.● 401 User does not have the rights to perform this action. Only the team administrator or group owner can
delete a group.● 404 Group or team not found.
Related Information
Get groups [page 13]
5.5 Add member to group
POST /v3/GroupMembers
● Description: Add a member to a group.
SAP Lumira Cloud Developer GuideCreating and managing groups © 2015 SAP SE or an SAP affiliate company. All rights reserved. 19
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 20/28
Note
The user must exist in SAP Lumira Cloud and belong to the same team as the user calling the API.
● Operation: POST● URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/v3/GroupMembers
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to.
Parameters
The following parameters must be included in the request body:
Parameter escription
GroupUuid The UUID of an existing group, that exists in the same teamas the user calling the API.
PrincipalUuid UUID of an existing user, that belongs to the same team asthe user calling the API.
Content-Type The format of the request header and response.
● JSON: application/json;charset=utf-8● XML: application/atom+xml;charset=utf-8
Response
201 Created
Errors
● 404 Group does not exist.● 404 User does not exist.● 403 User and Group do not belong to the same team.
20 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Creating and managing groups
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 21/28
5.6 Delete member from group
DELETE /v3/GroupMembers(GroupUuid='<GROUP_ID>',PrincipalUuid='<PRINCIPAL_ID>')
● Description: Removes a member from a group.● Operation: DELETE● URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/v3/GroupMembers(GroupUuid='<GROUP_ID>,PrincipalUuid='PRINCIPAL_ID'))
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to. Replace
<GROUP_ID> with the UUID of the group to de lete. Replace <PRINCIPAL_ID> with the UUID of the memberto delete.
● Parameters: None.● Response: 204 No Content .
Errors● 401 User does not have the rights to perform this action. Only the team administrator or group owner can
delete a group.● 404 Group or member not found.
Related Information
Get groups [page 13]
Get group members [page 21]
5.7 Get group members
GET /v3/Groups(userId='<USER_ID>',Uuid='<GROUP_ID>')/Members
● Description: Returns a list of all members in a group.● Operation: GET
SAP Lumira Cloud Developer GuideCreating and managing groups © 2015 SAP SE or an SAP affiliate company. All rights reserved. 21
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 22/28
● URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/v3/Groups(userId='<USER_ID>',Uuid='<GROUP_ID>')/Members)
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to. Replace
<USER_ID> with the UUID of the current user. Replace <GROUP_ID> with the UUID of the group.
● Parameters: None.
Example Response
200 OK
JSON:
{ "d": { "results": [{ "__metadata" : { "uri": "http://localhost:8080/v3/Members(GroupUuid='54294DB77F631444E10000000AA0D394',UserUuid='f8344476-6fa5-409c-a1d9-0b2fb69cd39b')", "type": "testvin.v3odatacalc.v3.MembersType" }, "GroupUuid": "54294DB77F631444E10000000AA0D394", "UserUuid": "f8344476-6fa5-409c-a1d9-0b2fb69cd39b", "Name" : "name of group member", "EmailAddress" : "email of the group member", "Status" : "Active", "Groups": { "__deferred": { "uri": "http://localhost:8080/v3/Members(GroupUuid='54294DB77F631444E10000000AA0D394',UserUuid='f8344476-6fa5-409c-a1d9-0b2fb69cd39b')/Groups" } }, "Principal": { "__deferred": { "uri": "http://localhost:8080/v3/Members(GroupUuid='54294DB77F631444E10000000AA0D394',UserUuid='f8344476-6fa5-409c-
a1d9-0b2fb69cd39b')/Principal" } } }] }}
XML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <feed xml:base="http://localhost:8080/v3/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"> <title type="text">Members</title>
<id>http://localhost:8080/v3/Members</id> <author>
22 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Creating and managing groups
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 23/28
<name /> </author> <link rel="self" title="Members" href="Members" /> <entry>
<id>http://localhost:8080/v3/Members(GroupUuid='54294DB77F631444E10000000AA0D394',UserUuid='f8344476-6fa5-409c-a1d9-0b2fb69cd39b')</id> <title type="text"/> <author> <name /> </author> <link rel="edit" title="Members"href="Members(GroupUuid='54294DB77F631444E10000000AA0D394',UserUuid='f8344476-6fa5-409c-a1d9-0b2fb69cd39b')"/> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Groups" type="application/atom+xml;type=feed" title="Groups" href="Members(GroupUuid='54294DB77F631444E10000000AA0D394',UserUuid='f8344476-6fa5-409c-a1d9-0b2fb69cd39b')/Groups"/> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Principal" type="application/atom+xml;type=entry" title="Principal" href="Members(GroupUuid='54294DB77F631444E10000000AA0D394',UserUuid='f8344476-6fa5-409c-a1d9-0b2fb69cd39b')/Principal"/> <category term="testvin.v3odatacalc.v3.MembersType" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:GroupUuid m:type="Edm.String">54294DB77F631444E10000000AA0D394</d:GroupUuid> <d:UserUuid m:type="Edm.String">f8344476-6fa5-409c-a1d9-0b2fb69cd39b</d:UserUuid> <d:Name m:type="Edm.String">name of group member</d:Name>
<d:EmailAddress m:type="Edm.String">email of the group member</d:EmailAddress> <d:Status m:type="Edm.String">Active</d:Status> </m:properties> </content> </entry></feed>
Note
The Status property of a group member can be either Active , Invited or Disabled .
5.8 Get groups a team member belongs to
GET /v3/Groups(userId='<USER_ID>')
● Description: Allows you to to view the groups that belong to a team member.
Note
Only applicable if the current user logged in to SAP Lumira Cloud is a team administrator.
● Operation: GET
SAP Lumira Cloud Developer GuideCreating and managing groups © 2015 SAP SE or an SAP affiliate company. All rights reserved. 23
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 24/28
● URL:
https://oauthasservices-<TENANT>.hana.ondemand.com/v3/Groups(userID="<USER_ID>")
Note
Replace <TENANT> with the tenant name of the SAP HANA system you want to connect to. Replace
<USER_ID> with the UUID of a team member.
Parameters
The following parameters must be included in the request body:
Parameter escription
Name The name of the group to be created. The name be unique tothe team or parent group if the new group is a subgroup.
ParentUuid The UUID of the parent group if the new group is a subgroup;otherwise enter an empty string ("") .
Content-Type The format of the request header and response.
● JSON: application/json;charset=utf-8● XML: application/atom+xml;charset=utf-8
Example Response
200 OK
JSON:
{ "d": { "results": [{ "__metadata": { "uri": "http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')", "type": "testvin.v3odatacalc.v3.GroupsType" }, "userId": "f8344476-6fa5-409c-a1d9-0b2fb69cd39b", "Uuid": "54294DB47F631444E10000000AA0D394", "Name": "a", "ParentUuid": "", "CurrentMembershipCount" : 1, "ExplicitMember": 0, "ImplicitMember": 1, "CurrentUserUuid": "f8344476-6fa5-409c-a1d9-0b2fb69cd39b", "Members": { "__deferred": { "uri": "http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')/Members"
} }
24 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Creating and managing groups
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 25/28
}, { "__metadata": { "uri": "http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')",
"type": "testvin.v3odatacalc.v3.GroupsType" }, "userId": "f8344476-6fa5-409c-a1d9-0b2fb69cd39b", "Uuid": "54294DB77F631444E10000000AA0D394", "Name": "b", "ParentUuid": "54294DB47F631444E10000000AA0D394", "CurrentMembershipCount" : 1, "ExplicitMember": 1, "ImplicitMember": 0, "CurrentUserUuid": "f8344476-6fa5-409c-a1d9-0b2fb69cd39b", "Members": { "__deferred": { "uri": "http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')/Members" } } }] }}
XML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <feed xml:base="http://localhost:8080/v3/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"xmlns="http://www.w3.org/2005/Atom"> <title type="text">Results</title> <id>http://localhost:8080/v3/Results</id> <author> <name /> </author> <link rel="self" title="Results" href="Results" /> <entry> <id>http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')</id> <title type="text"/> <author> <name /> </author> <link rel="edit" title="Groups" href="Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')"/> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Members" type="application/atom+xml;type=feed" title="Members" href="Groups(userId='f8344476-6fa5-409c-
a1d9-0b2fb69cd39b',Uuid='54294DB47F631444E10000000AA0D394')/Members"/> <category term="testvin.v3odatacalc.v3.GroupsType" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:userId m:type="Edm.String">f8344476-6fa5-409c-a1d9-0b2fb69cd39b</d:userId> <d:Uuid m:type="Edm.String">54294DB47F631444E10000000AA0D394</d:Uuid> <d:Name m:type="Edm.String">a</d:Name> <d:ParentUuid m:type="Edm.String"/> <d:CurrentMembershipCount m:type="Edm.Byte">1</d:CurrentMembershipCount> <d:ExplicitMember m:type="Edm.Byte">0</d:ExplicitMember> <d:ImplicitMember m:type="Edm.Byte">1</d:ImplicitMember> <d:CurrentUserUuid m:type="Edm.String">f8344476-6fa5-409c-a1d9-0b2fb69cd39b</d:CurrentUserUuid> </m:properties> </content>
SAP Lumira Cloud Developer GuideCreating and managing groups © 2015 SAP SE or an SAP affiliate company. All rights reserved. 25
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 26/28
</entry> <entry> <id>http://localhost:8080/v3/Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')</id>
<title type="text"/> <author> <name /> </author> <link rel="edit" title="Groups" href="Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')"/> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Members" type="application/atom+xml;type=feed" title="Members" href="Groups(userId='f8344476-6fa5-409c-a1d9-0b2fb69cd39b',Uuid='54294DB77F631444E10000000AA0D394')/Members"/> <category term="testvin.v3odatacalc.v3.GroupsType" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:userId m:type="Edm.String">f8344476-6fa5-409c-a1d9-0b2fb69cd39b</d:userId> <d:Uuid m:type="Edm.String">54294DB77F631444E10000000AA0D394</d:Uuid> <d:Name m:type="Edm.String">b</d:Name> <d:ParentUuid m:type="Edm.String">54294DB47F631444E10000000AA0D394</d:ParentUuid> <d:ExplicitMember m:type="Edm.Byte">1</d:ExplicitMember> <d:ImplicitMember m:type="Edm.Byte">0</d:ImplicitMember> <d:CurrentUserUuid m:type="Edm.String">f8344476-6fa5-409c-a1d9-0b2fb69cd39b</d:CurrentUserUuid> </m:properties> </content> </entry> </feed>
26 © 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.SAP Lumira Cloud Developer Guide
Creating and managing groups
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 27/28
Important Disclaimers and Legal Information
Coding Samples
Any software coding and/or code lines / strings ("Code") included in this doc umentation are only examples and are not intended to be used in a productive systemenvironment. The Code is only intended to better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness andcompleteness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage o f the Code, unless damages were caused by SAPintentionally or by SAP's gross negligence.
Accessibility
The information contained in the SAP documentation represents SAP's current view of accessibility criteria as of the date of publication; it is in no way intended to be abinding guideline on how to ensure accessibility of software products. SAP in particular disclaims any liability in relation to this document. This disclaimer, however, doesnot apply in cases of wilful misconduct or gross negligence of SAP. Furthermore, this document does not result in any direct or indirect co ntractual obligations of SAP.
Gender-Neutral Language
As far as possible, SAP documentation is gender neutral. Depending on the context, the reader is addressed directly with "you", or a gender-neutral noun (such as "salesperson" or "working days") is used. If when referring to members of both sexes, however, the third-person singular cannot be avoided or a gender-neutral noun does notexist, SAP reserves the right to use the masculine form of the noun and pronoun. This is to ensure that the documentation remains comprehensible.
Internet Hyperlinks
The SAP documentation may contain hyperlinks to the Internet. These hyperlinks are intended to serve as a hint about where to find related information. SAP does notwarrant the availability and correctness of this related information or the ability of this information to serve a particular purpose. SAP shall not be liable for any damagescaused by the use of related informa tion unless damages have been c aused by SAP's gross negligence or willful misconduct. All links are categorized for transparency(see: http://help.sap.com/disclaimer ).
SAP Lumira Cloud Developer GuideImportant Disclaimers and Legal Information © 2015 SAP SE or an SAP affiliate company. All rights reserved. 27
7/21/2019 LumC Developer En
http://slidepdf.com/reader/full/lumc-developer-en 28/28
www.sap.com/contactsap
© 2015 SAP SE or an SAP affiliate co mpany. All rights reserved.No part of this publication may be reproduced or transmitted in anyform or for any purpose without the express permission of SAP SEor an SAP affiliate company. The information contained herein maybe changed without prior notice.Some software products marketed by SAP SE and its distributorscontain proprietary software components of other softwarevendors. National product specifications may vary.These materials are provided by SAP SE or an SAP affiliate companyfor informational purposes only, without representation or warrantyof any kind, and SAP or its affiliated companies shall not be liable forerrors or omissions with respect to the materials. The onlywarranties for SAP or SAP affiliate company products and servicesare those that are set forth in the express warranty statementsaccompanying such products and services, if any. Nothing hereinshould be construed as constituting an additional warranty.
SAP and other SAP products and services mentioned herein as wellas their respective logos are trademarks or registered trademarksof SAP SE (or an SAP affiliate c ompany) in Germany and othercountries All other product and service names mentioned are the