APIs para SharePoint Online

Juan Carlos Gonzalez
Juan Carlos GonzalezMicrosoft 365 Apps & Services MVP | Microsoft 365 SME at CompartiMOSS
APIs para SharePoint Online
APIs para SharePoint Online
 Overview de las APIs de
Office 365 y SPO
 Posibilidades de las APIs
de SPO
 API REST
 Sabor JavaScript
 Sabor .NET
APIs para SharePoint Online
_api
_API
Client/Server/Mobile Symmetrical
OAuth Enabled
600+ Classes
Declarative, Remote Events
Fully Remote
3000+ MethodsODatajQuery Compatible
Private and Public Clouds
JSON
_api
Lists
Sites
Security
User
Profiles
Search
Taxonomy
_api
Feeds
Publishing
Sharing
Workflow
E-
Discovery
IRM
APIs para SharePoint Online
APIs para SharePoint Online
Colección de Sitios, Webs, Listas,
Elementos de Lista, Vistas,
Campos y Carpetas, elementos
de Lista y Documentos
Schemas, Files, and Folders
Posibilidades del MO Cliente
Web Parts,
Seguridad, Tipos
de Contenidos,
Plantillas de
Sitios
Perfiles de usuario,
Suministro de Noticias,
Búsqueda, Taxonomía,
Publicación
Flujos de Trabajo, E-
Discovery, IRM, BCS,
Búsquedas,
Traducciones, ---
Llamadas de domino cruzado
SPO Client SDK: http://www.microsoft.com/en-
us/download/details.aspx?id=42038
Context.Web.Lists
CSOM
Context.Web.Lists[guid]
Web.Lists.GetByTitle ("Title")
Context.Web.Lists[guid].Fields
Context.Web.SiteUsers
/_api/web/lists
REST
/_api/web/lists(‘guid’)
/_api/web/lists/getbytitle(‘Title’)
/_api/web/lists/getbytitle(‘Title’)/Fiel
d
/_api/web/siteusers
API REST URL JavaScript Client Namespace
Web http://weburl/_api/Web SP Microsoft.SharePoint.Client
Search http://weburl/_api/Search SP.Search Microsoft.SharePoint.Client.Search
Taxonomy http://weburl/_api/Taxonomy SP.Taxonomy Microsoft.SharePoint.Client.Taxonomy
BCS http://weburl/_api/BCS SP.BCS Microsoft.SharePoint.Client.BCS
APIs para SharePoint Online
…/_api/SP.UserProfiles.PeopleManager
…/_api/search
…/_api/publishing
…
APIs para SharePoint Online
• _api/web/lists/getbytitle(‘Lista')/it
ems?$Select=Title,EventDate
• _api/web/lists/getbytitle(‘Lista')/it
ems?$Filter=Categoria eq
'Trabajo‘
• _api/web/lists('<guid>')/items$to
p=10
APIs para SharePoint Online
APIs para SharePoint Online
 + fácil de procesar desde
código manejado
 Hay que usar la cabecera
“application/atom+xml” en
las peticiones
 + manejable si se usa
JavaScript (jQuery)
 Hay que usar la cabecera
“application/json”
X-RequestDigest:
(1) http://www.wictorwilen.se/sharepoint-2013-how-to-refresh-the-request-digest-value-
in-javascript
APIs para SharePoint Online
APIs para SharePoint Online
APIs para SharePoint Online
//REST URL
string sRESTUrl =
"https://itechcs.sharepoint.com/sites/CO365DeveloperSite/_api/web/lists";
//Petición Web
HttpWebRequest sphwrPeticion =
(HttpWebRequest)WebRequest.Create(sRESTUrl);
sphwrPeticion.Credentials =
new SPCOSM.SharePointOnlineCredentials(sSPOUser,ssPassword);
sphwrPeticion.Headers.Add(
"X-FORMS_BASED_AUTH_ACCEPTED", "f");
sphwrPeticion.Accept = "application/json;odata=verbose";
HttpWebResponse sphwrRespuesta =
(HttpWebResponse)sphwrPeticion.GetResponse();
StreamReader srReader =
new StreamReader(sphwrRespuesta.GetResponseStream());
string sData= srReader.ReadToEnd();
APIs para SharePoint Online
APIs para SharePoint Online
APIs para SharePoint Online
Lenguaje
Dinámico
APIs para SharePoint Online
APIs para SharePoint Online
APIs para SharePoint Online
APIs para SharePoint Online
APIs para SharePoint Online
APIs para SharePoint Online
APIs para SharePoint Online
 Load() and LoadQuery() inicializan las propiedades
 ExecuteQuery() realiza la llamada al servidor
 Podemos tener excepciones de tipo
PropertyOrFieldNotInitializedException
APIs para SharePoint Online
APIs para SharePoint Online
http://www.metricsthatmatter.com/student/evaluation.
asp?k=16302&i=892358
APIs para SharePoint Online
APIs para SharePoint Online
Developer
Patterns & Practices
2014
Introduction to
Office 365
Development
2015
Deep Dive into
the Office 365
App Model
Deep Dive into integrating
Office 365 APIs with your
standalone web application
development
Deep Dive into integrating
Office 365 APIs with your
mobile device development
Shipping your
Office 365 App
to the
Office Store
Deep dive into
the building blocks
and services of the
SharePoint platform
Deep Dive into Office
365 Development on
non-Microsoft Stack
APIs para SharePoint Online
1 of 44

Recommended

Transformar Personalizaciones al Modelo de Apps de SharePoint by
Transformar Personalizaciones al Modelo de Apps de SharePointTransformar Personalizaciones al Modelo de Apps de SharePoint
Transformar Personalizaciones al Modelo de Apps de SharePointJuan Carlos Gonzalez
2.3K views33 slides
SharePoint and Office Development Workshop by
SharePoint and Office Development WorkshopSharePoint and Office Development Workshop
SharePoint and Office Development WorkshopEric Shupps
830 views140 slides
Developing an intranet on office 365 by
Developing an intranet on office 365Developing an intranet on office 365
Developing an intranet on office 365Eric Shupps
2.6K views44 slides
SPTECHCON - Get Some REST - Taking Advantage of the SharePoint 2013 REST API by
SPTECHCON - Get Some REST - Taking Advantage of the SharePoint 2013 REST APISPTECHCON - Get Some REST - Taking Advantage of the SharePoint 2013 REST API
SPTECHCON - Get Some REST - Taking Advantage of the SharePoint 2013 REST APIEric Shupps
1.3K views30 slides
Alfresco As SharePoint Alternative - Architecture Overview by
Alfresco As SharePoint Alternative - Architecture OverviewAlfresco As SharePoint Alternative - Architecture Overview
Alfresco As SharePoint Alternative - Architecture OverviewAlfresco Software
6.6K views40 slides
AppSec 2007 - .NET Web Services Hacking by
AppSec 2007 - .NET Web Services HackingAppSec 2007 - .NET Web Services Hacking
AppSec 2007 - .NET Web Services HackingShreeraj Shah
5.9K views36 slides

More Related Content

Similar to APIs para SharePoint Online

Designing for SharePoint Provider Hosted Apps by
Designing for SharePoint Provider Hosted AppsDesigning for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted AppsRoy Kim
788 views29 slides
Programming With Amazon, Google, And E Bay by
Programming With Amazon, Google, And E BayProgramming With Amazon, Google, And E Bay
Programming With Amazon, Google, And E BayPhi Jack
1.1K views22 slides
Seattle StrongLoop Node.js Workshop by
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js WorkshopJimmy Guerrero
1.9K views81 slides
Exciting New Alfresco REST APIs by
Exciting New Alfresco REST APIsExciting New Alfresco REST APIs
Exciting New Alfresco REST APIsJ V
1.1K views39 slides
Share point 2013 developer training by
Share point 2013 developer trainingShare point 2013 developer training
Share point 2013 developer trainingbigitresearch
154 views2 slides
O365 Meetup Graz -Tome Tomovski - Beyond the limits of SharePoint by
O365 Meetup Graz -Tome Tomovski - Beyond the limits of SharePoint O365 Meetup Graz -Tome Tomovski - Beyond the limits of SharePoint
O365 Meetup Graz -Tome Tomovski - Beyond the limits of SharePoint Thomas Gölles
152 views22 slides

Similar to APIs para SharePoint Online(20)

Designing for SharePoint Provider Hosted Apps by Roy Kim
Designing for SharePoint Provider Hosted AppsDesigning for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted Apps
Roy Kim788 views
Programming With Amazon, Google, And E Bay by Phi Jack
Programming With Amazon, Google, And E BayProgramming With Amazon, Google, And E Bay
Programming With Amazon, Google, And E Bay
Phi Jack1.1K views
Seattle StrongLoop Node.js Workshop by Jimmy Guerrero
Seattle StrongLoop Node.js WorkshopSeattle StrongLoop Node.js Workshop
Seattle StrongLoop Node.js Workshop
Jimmy Guerrero1.9K views
Exciting New Alfresco REST APIs by J V
Exciting New Alfresco REST APIsExciting New Alfresco REST APIs
Exciting New Alfresco REST APIs
J V1.1K views
Share point 2013 developer training by bigitresearch
Share point 2013 developer trainingShare point 2013 developer training
Share point 2013 developer training
bigitresearch154 views
O365 Meetup Graz -Tome Tomovski - Beyond the limits of SharePoint by Thomas Gölles
O365 Meetup Graz -Tome Tomovski - Beyond the limits of SharePoint O365 Meetup Graz -Tome Tomovski - Beyond the limits of SharePoint
O365 Meetup Graz -Tome Tomovski - Beyond the limits of SharePoint
Thomas Gölles152 views
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기 by lanslote
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
[SharePoint Korea Conference 2013 / 강율구] Sharepoint 스마트하게 개발하기
lanslote3.4K views
Composite Applications Speaking Tour - Lap Around Office Business Architectures by Mike Walker
Composite Applications Speaking Tour - Lap Around Office Business ArchitecturesComposite Applications Speaking Tour - Lap Around Office Business Architectures
Composite Applications Speaking Tour - Lap Around Office Business Architectures
Mike Walker1.9K views
Java Script Based Client Server Webapps 2 by kriszyp
Java Script Based Client Server Webapps 2Java Script Based Client Server Webapps 2
Java Script Based Client Server Webapps 2
kriszyp4.4K views
Introduction to SAML 2.0 by Mika Koivisto
Introduction to SAML 2.0Introduction to SAML 2.0
Introduction to SAML 2.0
Mika Koivisto72.2K views
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon by SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SPTechCon1.3K views
OpenFilter Prototyping Weekend by JobT
OpenFilter Prototyping WeekendOpenFilter Prototyping Weekend
OpenFilter Prototyping Weekend
JobT284 views
Sales force developer_course_outline by Abdul Ghani
Sales force developer_course_outlineSales force developer_course_outline
Sales force developer_course_outline
Abdul Ghani882 views
Web 2.0 Application Kung-Fu - Securing Ajax & Web Services by Shreeraj Shah
Web 2.0 Application Kung-Fu - Securing Ajax & Web ServicesWeb 2.0 Application Kung-Fu - Securing Ajax & Web Services
Web 2.0 Application Kung-Fu - Securing Ajax & Web Services
Shreeraj Shah82K views
Getting Started with the Node.js LoopBack APi Framework by Jimmy Guerrero
Getting Started with the Node.js LoopBack APi FrameworkGetting Started with the Node.js LoopBack APi Framework
Getting Started with the Node.js LoopBack APi Framework
Jimmy Guerrero3.5K views
The RESTful Soa Datagrid with Oracle by Emiliano Pecis
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with Oracle
Emiliano Pecis14.7K views

More from Juan Carlos Gonzalez

Boost your Teams Meetings to the next level with Teams Premium by
Boost your Teams Meetings to the next level with Teams PremiumBoost your Teams Meetings to the next level with Teams Premium
Boost your Teams Meetings to the next level with Teams PremiumJuan Carlos Gonzalez
3 views53 slides
Stream en SharePoint en detalle by
Stream en SharePoint en detalle Stream en SharePoint en detalle
Stream en SharePoint en detalle Juan Carlos Gonzalez
23 views43 slides
Power Platform y Teams: ¿Qué platos tengo en mi menú? by
Power Platform y Teams: ¿Qué platos tengo en mi menú?Power Platform y Teams: ¿Qué platos tengo en mi menú?
Power Platform y Teams: ¿Qué platos tengo en mi menú?Juan Carlos Gonzalez
38 views36 slides
Digitaliza tus procesos de Aprobación con Approvals en Teams: ¿Qué hay de nue... by
Digitaliza tus procesos de Aprobación con Approvals en Teams: ¿Qué hay de nue...Digitaliza tus procesos de Aprobación con Approvals en Teams: ¿Qué hay de nue...
Digitaliza tus procesos de Aprobación con Approvals en Teams: ¿Qué hay de nue...Juan Carlos Gonzalez
33 views49 slides
Stream on SharePoint, an overview - JcGonzalez.pptx by
Stream on SharePoint, an overview - JcGonzalez.pptxStream on SharePoint, an overview - JcGonzalez.pptx
Stream on SharePoint, an overview - JcGonzalez.pptxJuan Carlos Gonzalez
145 views43 slides
Shared channels in Microsoft Teams, an overview by
Shared channels in Microsoft Teams, an overview Shared channels in Microsoft Teams, an overview
Shared channels in Microsoft Teams, an overview Juan Carlos Gonzalez
46 views33 slides

More from Juan Carlos Gonzalez(20)

Boost your Teams Meetings to the next level with Teams Premium by Juan Carlos Gonzalez
Boost your Teams Meetings to the next level with Teams PremiumBoost your Teams Meetings to the next level with Teams Premium
Boost your Teams Meetings to the next level with Teams Premium
Power Platform y Teams: ¿Qué platos tengo en mi menú? by Juan Carlos Gonzalez
Power Platform y Teams: ¿Qué platos tengo en mi menú?Power Platform y Teams: ¿Qué platos tengo en mi menú?
Power Platform y Teams: ¿Qué platos tengo en mi menú?
Digitaliza tus procesos de Aprobación con Approvals en Teams: ¿Qué hay de nue... by Juan Carlos Gonzalez
Digitaliza tus procesos de Aprobación con Approvals en Teams: ¿Qué hay de nue...Digitaliza tus procesos de Aprobación con Approvals en Teams: ¿Qué hay de nue...
Digitaliza tus procesos de Aprobación con Approvals en Teams: ¿Qué hay de nue...
Digitaliza tus Aprobaciones con Approvals en Teams - JcGonzalez .pptx by Juan Carlos Gonzalez
Digitaliza tus Aprobaciones con Approvals en Teams - JcGonzalez .pptxDigitaliza tus Aprobaciones con Approvals en Teams - JcGonzalez .pptx
Digitaliza tus Aprobaciones con Approvals en Teams - JcGonzalez .pptx
Microsoft 365 Chicago - Governing Microsoft Teams Meetings by Juan Carlos Gonzalez
Microsoft 365 Chicago - Governing Microsoft Teams MeetingsMicrosoft 365 Chicago - Governing Microsoft Teams Meetings
Microsoft 365 Chicago - Governing Microsoft Teams Meetings
Solicita y comparte actualizaciones con Updates en Teams by Juan Carlos Gonzalez
Solicita y comparte actualizaciones con Updates en TeamsSolicita y comparte actualizaciones con Updates en Teams
Solicita y comparte actualizaciones con Updates en Teams
Shared channels in Microsoft Teams, an overview - JcGonzalez.pptx by Juan Carlos Gonzalez
Shared channels in Microsoft Teams, an overview - JcGonzalez.pptxShared channels in Microsoft Teams, an overview - JcGonzalez.pptx
Shared channels in Microsoft Teams, an overview - JcGonzalez.pptx
Governing Microsoft Teams Meetings: What are my options? by Juan Carlos Gonzalez
Governing Microsoft Teams Meetings: What are my options?Governing Microsoft Teams Meetings: What are my options?
Governing Microsoft Teams Meetings: What are my options?
Power Platform y Teams: ¿Qué platos tengo en mi menú? by Juan Carlos Gonzalez
Power Platform y Teams: ¿Qué platos tengo en mi menú?Power Platform y Teams: ¿Qué platos tengo en mi menú?
Power Platform y Teams: ¿Qué platos tengo en mi menú?
Digitalize your Approval processes with approvals in Microsoft Teams by Juan Carlos Gonzalez
Digitalize your Approval processes with approvals in Microsoft TeamsDigitalize your Approval processes with approvals in Microsoft Teams
Digitalize your Approval processes with approvals in Microsoft Teams
Digitaliza tus Aprobaciones con Approvals en Microsoft Teams by Juan Carlos Gonzalez
Digitaliza tus Aprobaciones con Approvals en Microsoft TeamsDigitaliza tus Aprobaciones con Approvals en Microsoft Teams
Digitaliza tus Aprobaciones con Approvals en Microsoft Teams
Microsoft Lists o como crear aplicaciones a la velocidad de la luz para M365 ... by Juan Carlos Gonzalez
Microsoft Lists o como crear aplicaciones a la velocidad de la luz para M365 ...Microsoft Lists o como crear aplicaciones a la velocidad de la luz para M365 ...
Microsoft Lists o como crear aplicaciones a la velocidad de la luz para M365 ...
Microsoft Lists o como crear aplicaciones a la velocidad de la luz para M365 ... by Juan Carlos Gonzalez
Microsoft Lists o como crear aplicaciones a la velocidad de la luz para M365 ...Microsoft Lists o como crear aplicaciones a la velocidad de la luz para M365 ...
Microsoft Lists o como crear aplicaciones a la velocidad de la luz para M365 ...

Recently uploaded

Michael Jordan and the Three-Point Shot by
Michael Jordan and the Three-Point ShotMichael Jordan and the Three-Point Shot
Michael Jordan and the Three-Point ShotSohrab Tebyanian
7 views5 slides
Constitution Quiz.pptx by
Constitution Quiz.pptxConstitution Quiz.pptx
Constitution Quiz.pptxDanPaulJacob
17 views27 slides
LUDO GAME DEVELOPMENT COMPANY.pptx by
LUDO GAME DEVELOPMENT COMPANY.pptxLUDO GAME DEVELOPMENT COMPANY.pptx
LUDO GAME DEVELOPMENT COMPANY.pptxpurvidadliwork
6 views9 slides
BQC Cricket Quiz by Rudra Chakraborty.pptx by
BQC Cricket Quiz by Rudra Chakraborty.pptxBQC Cricket Quiz by Rudra Chakraborty.pptx
BQC Cricket Quiz by Rudra Chakraborty.pptxRudra Chakraborty
17 views35 slides
INMOTION PRODUCTS by
INMOTION PRODUCTSINMOTION PRODUCTS
INMOTION PRODUCTSMark Zhang
17 views37 slides

APIs para SharePoint Online

Editor's Notes

  1. Ruta de instalación de los ensamblados: C:\Program Files\Common Files\microsoft shared\Web Server Extensions y en la GAC
  2. Ejemplos de parámetros: el Guid de una lista
  3. To understand how to use OData as a developer, you must understand how OData URIs are constructed. Each URI has three significant parts, The first part of the URI is the Service root URI which points to a site on the Internet and a path to an entry point such as a .svc file. The next part of the URI is the Resource path which identifies a specific object such as a site, a collection (e.g list) or an entry (e.g. item). The final part of the URI are the optional query string parameters that allow you to request special processing instructions such as filtering and sorting.
  4. This is a READ sample. The other CRUD operations follow.
  5. Response data format selected with ACCEPT header XML can be easier to deal with from managed code. To get ATOM XML response use "application/atom+xml" JSON is easier to deal with when using JavaScript. To get JSON response use "application/json" When you run REST-based queries against SharePoint 2013 sites, you have the option of having the data returned as either XML in the ATOM format or JSON (JavaScript Object Notation). The default behavior is to return XML but you can change this default behavior to return JSON by including the ACCEPT header with a value of "application/json". If you include the ACCEPT header with an explicit value of "application/atom+xml", this has the same result as the default behavior in that the results are returned as ATOM-based XML. As a general rule of thumb, it is easier to deal with XML-based results when writing managed code such as C# or VB.NET. Likewise, it is easier to deal with JSON results when programming with JavaScript. Note that jQuery makes dealing with JSON results even easier.
  6. SharePoint 2013 (and previous versions) uses a client side “token” to validate posts back to SharePoint to prevent attacks where the user might be tricked into posting data back to the server. This token is known by many names;form digest or message digest or request digest. The token is unique to a user and a site and is only valid for a (configurable) limited time.
  7. Modificar con parte específica de SPO -------------------------------------------------- If you are making REST calls into SharePoint 2013 using C# or VB.NET, there are a few tips to make things easier. First, .NET 4.0 added a two new classes named HttpWebRequest and HttpWebResponse which provide a few conveniences not offered by their base classes WebRequest and WebResponse. For example, there is a stongly-typed Accept property on the HttpWebRequest object that allows you to set the ACCEPT header. When it's time to retrieve data values from elements within an XML document, it's time to abandon older XML APIs such as XMLReader in favor of Linq to XML and the XDocument class. Retrieving data from an XML document using the Descendants property of an XDocument object as shown above makes dealing with nested elements and XML namespaces so much easier.
  8. Modificar con parte específica de SPO -------------------------------------------------- If you are making REST calls into SharePoint 2013 using C# or VB.NET, there are a few tips to make things easier. First, .NET 4.0 added a two new classes named HttpWebRequest and HttpWebResponse which provide a few conveniences not offered by their base classes WebRequest and WebResponse. For example, there is a stongly-typed Accept property on the HttpWebRequest object that allows you to set the ACCEPT header. When it's time to retrieve data values from elements within an XML document, it's time to abandon older XML APIs such as XMLReader in favor of Linq to XML and the XDocument class. Retrieving data from an XML document using the Descendants property of an XDocument object as shown above makes dealing with nested elements and XML namespaces so much easier.
  9. Modificar con parte específica de SPO y funcionando… -------------------------------------------------- This slide shows the code which demonstrates creating a new list using client-side C# code which uses the new REST entry point. The first task it to parse together URL to point to lists collection which is _api/web/lists. The next task is to add the X-RequestDigest header which includes the value of the form digest. This example also sets the ContentType header to a value of application/atom+xml to tell SharePoint it is passing XML as opposed to JSON. Next, you must create an XML document that contains an Entry as defined by ATOM and conforms to the structure used by SharePoint 2013. The last task is to execute the request using an HTTP POST operation.
  10. API REST desde PowerShell y desde .NET
  11. Demo de NAPA
  12. Load() and LoadQuery() inicializan las propiedades. ExecuteQuery() realiza la llamada al servidor. Podemos tener excepciones de tipo PropertyOrFieldNotInitializedException.
  13. This is a READ sample. The other CRUD operations follow.
  14.  SP 2013 Client Browser CAML Designer Scripts PowerShell: El de Obtener Sitios de una Colección, el de Flujos
  15. Transform your code - Providing App Model Patterns for common Full Trust Code scenarios 60+ Visual Studio projects Common scenarios