WORKING WITH THE “CALL HTTP WEB SERVICE” WORKFLOW ACTIVITY Derek Nishino Nishino Consulting

Slides:



Advertisements
Similar presentations
Peter Millington SHERPA Technical Development Officer University of Nottingham, England Application Programmers Interface Digital Repositories: Dealing.
Advertisements

November 11, MCT, MCITP, MCTS, MCP SharePoint Architect for Planet Technologies. Working with SharePoint since – Administrator / Developer.
CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
#spsevents #spsphx SPS EVENTS PHX Know REST for the Query AN INTRODUCTION TO REST FOR SHAREPOINT 2013 ERIC J OSZAKIEWSKI, MCTS, MS, MCPS.
Microsoft ® Official Course Client-Side SharePoint Development SharePoint Practice Microsoft SharePoint 2013.
2010/11 : [1]Building Web Applications using MySQL and PHP (W1)MySQL Recap.
Programming Logic and Design Fourth Edition, Comprehensive
1 The World Wide Web. 2  Web Fundamentals  Pages are defined by the Hypertext Markup Language (HTML) and contain text, graphics, audio, video and software.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Agenda Overview 2.What is SharePoint? 3.NCDOT Websites 4.Roles 5.Search 6.SharePoint Interface.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Create with SharePoint 2010 Jen Dodd Sr. Solutions Consultant
131 Agenda Overview Review Roles Lists Libraries Columns.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
How a little code can help with support.. Chris Barba – Developer at Cimarex Energy Blog:
CO1552 – Web Application Development Lists, Special Characters, and Tables.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation.
ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua.NET/Cloud Computing UG Lead Blog:
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
What’s New? – BCS 2013 Brett Lonsdale.  Co-founder of Lightning Tools  One of the hosts on the SharePoint Pod Show  Co-organizer of SharePoint Saturday.
© 2011 PLANET TECHNOLOGIES, INC. Create a FREE Weather RSS Web Part Patrick Curran, MCT AUGUST 12, 2011.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Tom Castiglia Hershey Technologies
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
1 Working with MS SQL Server Textbook Chapter 14.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
Lecture 8 – Cookies & Sessions SFDV3011 – Advanced Web Development 1.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
Introduction to the SharePoint 2013 REST API. 2 About Me SharePoint Solutions Architect at Sparkhound in Baton Rouge
HTML, PHP, and MySQL: Putting It All Together. Making a Form Input tags Types: “text” “radio” “checkboxes” “submit”
Dynamic Programming with PHP (mktime), Cookies, SQL, Authentication.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Cookies and Sessions IDIA 618 Fall 2014 Bridget M. Blodgett.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Profiles and Active Directory Overview User profiles –Import from Active Directory –Creating.
HTML Forms. Slide 2 Forms (Introduction) The purpose of input forms Organizing forms with a and Using different element types to get user input A brief.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
INTRO TO SHAREPOINT WORKFLOWS Derek Nishino Nishino Consulting
ICM – API Server & Forms Gary Ratcliffe.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Welcome to Azure App Services! Amie Seisay
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
ITM © Port,Kazman 1 ITM 352 Cookies. ITM © Port,Kazman 2 Problem… r How do you identify a particular user when they visit your site (or any.
NMD202 Web Scripting Week2. Web site
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Leveraging SharePoint Search In SharePoint 2013 Jameson Bozeman.
#SummitNow What's Coming Arrived in CMIS November, 2013 Gregory Melahn/Alfresco Software
Use Outlook Task API to access tasks stored on user’s mailbox. These REST API’s are  Simple to use.  Supports CRUD.  JSON structured.  OAuth 2.0.
Exam Friday April 11. MongoDB Specifics Find() to Query db.collection.find(, ) db.collection.find{{select conditions}, {project columns}) Selection conditions:
Redmond Protocols Plugfest 2016 Andrew Davidoff Mail, Calendar, and Contacts Graph API Demonstration Senior Software Engineer.
Data and tools on the Web have been exposed in a RESTful manner. Taverna provides a custom processor for accessing such services.
Benjamin Niaulin Presented at: SharePoint Fest Chicago SharePoint Geek Content Query Web Part – Get it all in one place and style it!
Unit 9.1 Learning Objectives Data Access in Code
APAN SharePoint Permissions
Beyond the BDC\BCS Model
SharePoint Architect & Developer
LMEvents SharePoint Portal How-to Guide
Leveraging BI in SharePoint with PowerPivot and Power View
An introduction to REST for SharePoint 2013
BASIC PHP and MYSQL Edward S. Flores.
Ben Burbridge, Rebecca Jones, Hilary Newman Product Development
WEB API.
ISC440: Web Programming 2 Server-side Scripting PHP 3
Site scripts and Site Design
Performance Log REST Endpoint
Microsoft Graph – Intune API’s
Presentation transcript:

WORKING WITH THE “CALL HTTP WEB SERVICE” WORKFLOW ACTIVITY Derek Nishino Nishino Consulting

Agenda  What is the “Call HTTP Web Service” Workflow Activity?  What Can It Do?  SharePoint REST Web Services  SharePoint Designer Workflow Dictionary Variables  Retrieving Items from a SharePoint List  Writing to a SharePoint List  Gotchas

What Is It?  SharePoint Designer workflow activity for 2013-style workflows  Makes calls to REST web services, including the SharePoint web services  Allows looping through data such as items from a SharePoint list in a targeted way  NOT LIMITED TO CALLING SHAREPOINT’S REST WEB SERVICES  HTTP GET, PUT, POST, DELETE  Must support OData and JSON

Dictionaries  A new type of workflow variable  Used to hold data structures for calling REST web services  Similar to concept of arrays in software development  Can also think of them as lists of data within your workflow  Can have Dictionaries nested in Dictionaries

Dictionary Actions  Build Dictionary  Get an Item from a Dictionary  Count Items in Dictionary

Connecting to SharePoint 2013 On-Prem  Create variables  restURL (string) – contains URL to REST API call  Format is siteurl/_api/web/lists/getbytitle(‘list name’)/items  Can test to make sure your URL is correctly formed by pasting into web browser address bar, must be signed in to the tenant  requestHeaders (Dictionary) – contains two headers that you add using the “Build Dictionary” action  Name=Accept, Type=String, Value=application/json;odata=verbose  Name=Content-Type, Type=String, Value=application/json;odata=verbose  responseContent (Dictionary) – holds the list content that’s returned  reponseHeaders (Dictionary)

Connecting to SharePoint 2013 On-Prem  Add “Call HTTP Web Service” action  Should automatically create a String variable called responseCode  Set “Call HTTP Web Service” action properties as follows (easiest to set from properties window)  Address = restURL variable  RequestType = HTTP GET  RequestHeaders = requestHeaders variable  ResponseContent = responseContent variable  ReponseHeaders = responseHeaders variable  ResponseStatuesCode = responseCode variable

DEMO

Connecting to SharePoint 2013 Online  Lot’s of confusing blogs and other articles out there that tell you to  Use Fiddler to find authentication token and other headers  Add unnecessary headers (x-request, content-length)  Hard code your authentication token into the web service call!  Actually much easier than that if you’re just reading a list, just need to add the Host name to the RequestHeader  Just the URL to your SharePoint Online tenant  e.g. nishinoconsulting.sharepoint.com

Looping Through Items  List items are returned to dictionary variable responseContent  List items are stored in dictionary item called “d/results”  Create a variable called Results, it will be used to get a count of the number of list items returned  Use the “Get an Item from a Dictionary” action to get Results from responseContent  item by name or path = d/results  dictionary = responseContent variable  item = Results variable

Looping Through Items  Need to tell the loop how many times to run and a way to keep track of which item we’re working with  Create Integer variables to manage the loop  Count – tells the loop how many times to run, populate it with the “Count Items in Dictionary” action  Index – keeps track of which item we’re currently working with in resultsContent, set to have a default value of 0  IndexPlusOne – used to increment the Index when we (can’t just do an Index++ operation)

Looping Through Items  Create variables for each “column” from the results you’re going to be working with  Use “Get an Item from a Dictionary” to pull the column values from each row of results into your variables  Use the variables the same way you would use any workflow variable  Use in workflow  Write a message to the log  Perform comparisons  etc…  Increment your Index by adding one to it  Need to use and intermediary variable (IndexPlusOne)

Filtering Results  Don’t always want all items in a list  REST supports use of logical operators in the URL to filter results  Less Than, Equal To, Greater Than or Equal To, etc.  REST has operations for numbers, strings, and dates – not all are supported by SharePoint  Can specify columns, sort order, and more  Add “?$filter=“ without quotes to the end of your REST URL with the logical operation after the “=“  e.g. “?$filter=ID gt 20” returns items in the list with an ID greater than 20  Use “and” to specify multiple filters  e.g. “?$filter=ID gt 20 and ID lt 50” returns list items with an ID greater than 20 but less than 50

Gotchas  Can be difficult to troubleshoot  Authentication requirements in SharePoint Online make it challenging to make REST calls outside of the immediate site  May not actually be possible to do cross-farm calls

Resources  Step-by-Step Guide for Reading List Items   OData Query Operations   MSDN Intro to SharePoint 2013 REST   Step-by-Step Guide for Updating List Items 

THANK YOU!!!