320 likes | 809 Views
Jaap Mollema. SharePoint 2013 – REST, JSON and SharePoint Designer. Jaap Mollema SharePoint Consultant Microsoft Services Jaap.Mollema@microsoft.com http://nl.linkedin.com/in/jaapmollema /. Vandaag. Acties & Workflow Interop REST Endpoints REST in SharePoint Designer Workflows
E N D
Jaap Mollema SharePoint 2013 – REST, JSON and SharePoint Designer
Jaap MollemaSharePoint ConsultantMicrosoft ServicesJaap.Mollema@microsoft.comhttp://nl.linkedin.com/in/jaapmollema/
Vandaag • Acties & Workflow Interop • REST Endpoints • REST in SharePoint Designer Workflows • Verderdaneen site
Actiesbeschikbaar in 2013 To much text?
Actiesnietbeschikbaar in 2013 There’s more
REST Site - _api/web/ Lijstenof bibliotheken • _api/web/lists/ • _api/web/lists/getByTitle(‘[LIST NAME’) • _api/web/lists/guid’[GUID ID]’) Search • _api/search/query (retrieve results) • _api/search/postquery (POST, no URI length restricitions) • _api/search/suggest (query suggestions) User Profiles • _api/SP.UserProfiles.PeopleManager
REST DESC!!!
REST • In SharePoint Designer: • GET (ophalenresultaten) • POST (wegschrijvenresultaten) & MERGE alsonderdeel in de header • PUT (vervangen data) • DELETE (verwijderen data)
Case • Offerte reviewers • Afhankelijk van offertebedrag moeten bepaalde personen het document goedkeuren. • SharePoint Library: Proposals • SharePoint Lijst: Routing Table
Call • Stap 1: OphalenLijst: • /_api/web/lists/GetByTitle('Routing%20Table')/items • Stap 2: Beperken tot bedragen lager dan het offertebedrag • /_api/web/lists/GetByTitle('Routing%20Table')/items?$filter=(Amount lt '5000') • Stap 3: Hoogstebedragbovenaan • /_api/web/lists/GetByTitle('Routing%20Table')/items?$orderby=Amount desc&$filter=(Amount lt'5000')
Headers • Nodig: • Method: GET • Request: _api/web/lists/GetByTitle('Routing%20Table')/ items?$orderby=Amount desc&$filter=(Amount lt '5000') • Accept: application/json;odata=verbose • Content-Type: application/json;odata=verbose • Nietnodig • Authorization
List Type • List Item Entity Type Full Name • _api/web/lists/getbytitle('Resources')?$select=ListItemEntityTypeFullName
Headers • Nodig: • Method: POST • Request: _api/web/lists/GetByTitle(‘Update Feed')/ items • Accept: application/json;odata=verbose • Content-Type: application/json;odata=verbose • __metadata • Nietnodig • Authorization
App Permissions • Locatie van de workflow: • _layouts/15/appprincipals.aspx?Scope=Web • Workflow:i:0i.t|ms.sp.ext|8208be62-6ae6-4ccc-894c-14d8d9b9fbeb@37153b50-af42-4e1a-97e5-da30ae7efa80 • Locatie van de lijst • _layouts/15/oauthauthorize.aspx?client_id=8208be62-6ae6-4ccc-894c-14d8d9b9fbeb&response_type=code&scope=Search.QueryAsUserIgnoreAppPrincipal • Read of Write of Manage of Full Controll • Web.ReadSite.ReadList.Read
Tips • Begin altijd binnen de context van een (sub)site (web) • Maakgebruik van een TEMP lijstvoor JSON response • Test call in je browser • Bewaar je workflow als template en enable hem op verschillende subsites middels solutions
Links • How to: Complete basic operations using SharePoint 2013 REST endpoints: • http://msdn.microsoft.com/en-us/library/jj164022.aspx • Search REST API: • http://blogs.msdn.com/b/nadeemis/archive/2012/08/24/sharepoint-2013-search-rest-api.aspx • Get Started with the SharePoint 2013 REST Service: • http://msdn.microsoft.com/en-us/library/fp142380.aspx • Programming using the SharePoint 2013 REST service: • http://msdn.microsoft.com/en-us/library/fp142385.aspx • Understanding the SharePoint REST API: • http://msdn.microsoft.com/en-us/magazine/dn198245.aspx