SlideShare une entreprise Scribd logo
1  sur  29
Intro to the Alfresco Public
API
Jeff Potts
Chief Community Officer
Doesn’t Alfresco already have
an API?
Yes, but…
• Not really public (things change)
• Not versioned
• Not well documented
• Doesn’t work for cloud
The Alfresco Public API addresses these
limitations
Vision is to have a single API that works
across cloud and on-premise
API Launch Partners
Folder, file, content
and metadata
manipulation and
search
Networks, sites,
people, comments,
tags, activities, …
Getting Started
1. Understand OAuth2
2. Register your app
3. Grab a client-side CMIS library
• Or an SDK if coding a mobile app
4. Start coding!
Step 1: Groking OAuth2
Defined in RFC-6749
Secure authentication
• 3rd party apps don’t ever see the user’s
password
Unambiguously identifies:
• API provider (e.g. Alfresco)
• Client application (e.g. your application)
• End-user (e.g. an Alfresco Cloud user)
OAuth2 & Alfresco
Used to secure the Alfresco API
Only authentication mechanism provided for
APIs in Alfresco Cloud
Registering an App
Application
Developer
Alfresco
Developer Portal
Creates developer
profile
Assigns an API key
and secret for that
app
Signs up on
developer portal
Registers an
application
Authorization
Application Alfresco End-User
Links to Alfresco
authorization page,
passing API key &
secret
Asks the user to
authorize the app
User authorizes the
app to access their
account
Redirects to your
app’s callback
URL, passing
authorization code
Exchanges the
authorization code
for an access token
Returns access and
refresh tokens
Securely persists
the access and
refresh token for
that user
Making API Calls
Calls APIs, passing
the access token in
the Authorization
HTTP header
Identifies user from
access token,
executes API call
Application Alfresco
Refresh Flow
Calls APIs, passing
the access token in
the Authorization
HTTP header
Returns 401 error,
indicating access
token has expired
Refreshes access
token, passing
refresh token
Returns new access
token
Application Alfresco
OAuth2 library can hide
details
Spring Social
http://www.springsource.org/spring-social
Google OAuth2 Client
https://developers.google.com/accounts/doc
s/OAuth2#libraries
Step 2: Register Your App
http://www.alfresco.com/develop
• Alfresco Cloud Account
• Registered Developer Account
Add as many applications as you want
Key, secret, callback URL
Step 3: CMIS Library
Apache Chemistry is the umbrella project for
all CMIS related projects at the ASF
• OpenCMIS (Java, client and server)
• cmislib (Python, client)
• phpclient (PHP, client)
• DotCMIS (.NET, client)
• ObjectiveCMIS (Objective-C)
Other client libraries exist
REST client
http://youtu.be/5QS0CNsPJEY
Create, Find, & Comment
http://youtu.be/1ZtmoPdCKJI
Alfresco API URLs
Structure:
• Tenant
• API scope
• API name
• API version
• Entity type
https://api.alfresco.com/
* The notion of entity types doesn’t apply to CMIS.
*
public/acme.com/ sitesalfresco/versions/1/
Entity type collections
The entity type URL represents a collection
of all instances of that entity
• The collection may or may not be
retrievable via a GET
Each instance of an entity can be accessed
via the collection URL with an Id appended
.../acme.com/public/alfresco/versions/1/sites/mullet-gallery
Top level entity types
sites
people
tags
nodes
favorites
Nesting entity types
Entity types may also be nested
The same rule about retrieving instances by
Id applies
.../acme.com/public/alfresco/versions/1/sites/mullet-gallery/members
.../acme.com/public/alfresco/versions/1/sites/mullet-
gallery/members/pmonks@alfresco.com
Create, update, & delete
Creating a new entity instance:
• POST to the collection URL
Updating an entity instance:
• PUT to the instance URL
Deleting an entity instance:
• DELETE against the instance URL
These rules apply regardless of whether it’s
a top-level or nested collection
Considerations
Rate limits
• 5 requests/second, 10,000 requests/day (Dev)
• 50 requests/second, 100,000 requests/day (Prod)
No limit on # of applications
Alfresco Cloud users own their content
>= OpenCMIS 0.8.0-SNAPSHOT
>= cmislib 0.5.1dev
Roadmap
Merge APIs into Alfresco Enterprise v4.2
New API types:
• User Provisioning (SCIM)
• Workflow (Activiti)
New API versions:
• CMIS v1.1
• Alfresco v2 (?)
New Alfresco API entity types:
• renditions
• bulk-imports (?)
Roadmap
Binary property support
Projection & transclusion improvements
(“SELECT”)
Restriction improvements (“WHERE”)
Discoverability improvements
• In support of “executable documentation”
Getting Help
Docs: http://www.alfresco.com/develop
Resources:
• Alfresco API forum
• #alfresco on freenode IRC
• Alfresco Technical Discussion Google Group
Source Code:
• Code from DevCon Session
• Spring Social Alfresco Library
• Peter’s Grails Example
• Jeff’s Java Examples & Python Examples
Read the book!
Everything you need to
know about CMIS
1.0 & 1.1
Lots of Groovy and
Java examples
Also covers Python,
Android, & iOS
Now on MEAP!
37%-off: 12cmisal
The keys to one badass ECM platform are yours for
the taking
http://www.alfresco.com/develop
http://www.flickr.com/photos/ph-stop/3101407532/

Contenu connexe

Tendances

Alfresco REST API of the future ... is closer than you think
Alfresco REST API of the future ... is closer than you thinkAlfresco REST API of the future ... is closer than you think
Alfresco REST API of the future ... is closer than you think
J V
 

Tendances (20)

Storage and Alfresco
Storage and AlfrescoStorage and Alfresco
Storage and Alfresco
 
Alfresco REST API of the future ... is closer than you think
Alfresco REST API of the future ... is closer than you thinkAlfresco REST API of the future ... is closer than you think
Alfresco REST API of the future ... is closer than you think
 
Apache NiFi User Guide
Apache NiFi User GuideApache NiFi User Guide
Apache NiFi User Guide
 
Alfresco Transform Service DevCon 2019
Alfresco Transform Service DevCon 2019Alfresco Transform Service DevCon 2019
Alfresco Transform Service DevCon 2019
 
Actions rules and workflow in alfresco
Actions rules and workflow in alfrescoActions rules and workflow in alfresco
Actions rules and workflow in alfresco
 
Ef09 installing-alfresco-components-1-by-1
Ef09 installing-alfresco-components-1-by-1Ef09 installing-alfresco-components-1-by-1
Ef09 installing-alfresco-components-1-by-1
 
Architectural changes in the repo in 6.1 and beyond
Architectural changes in the repo in 6.1 and beyondArchitectural changes in the repo in 6.1 and beyond
Architectural changes in the repo in 6.1 and beyond
 
AD & LDAP
AD & LDAPAD & LDAP
AD & LDAP
 
Guide to alfresco monitoring
Guide to alfresco monitoringGuide to alfresco monitoring
Guide to alfresco monitoring
 
Securing Hadoop with Apache Ranger
Securing Hadoop with Apache RangerSecuring Hadoop with Apache Ranger
Securing Hadoop with Apache Ranger
 
Customizing the Document Library
Customizing the Document LibraryCustomizing the Document Library
Customizing the Document Library
 
Webscripts
WebscriptsWebscripts
Webscripts
 
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
HTTP by Hand: Exploring HTTP/1.0, 1.1 and 2.0
 
Discovering the 2 in Alfresco Search Services 2.0
Discovering the 2 in Alfresco Search Services 2.0Discovering the 2 in Alfresco Search Services 2.0
Discovering the 2 in Alfresco Search Services 2.0
 
Alfresco - You probably didn't know that
Alfresco - You probably didn't know thatAlfresco - You probably didn't know that
Alfresco - You probably didn't know that
 
Dangling DNS records takeover at scale
Dangling DNS records takeover at scaleDangling DNS records takeover at scale
Dangling DNS records takeover at scale
 
Logstash
LogstashLogstash
Logstash
 
Apache Spark Streaming in K8s with ArgoCD & Spark Operator
Apache Spark Streaming in K8s with ArgoCD & Spark OperatorApache Spark Streaming in K8s with ArgoCD & Spark Operator
Apache Spark Streaming in K8s with ArgoCD & Spark Operator
 
Learning how AWS implement AWS VPC CNI
Learning how AWS implement AWS VPC CNILearning how AWS implement AWS VPC CNI
Learning how AWS implement AWS VPC CNI
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 

En vedette

2140 api developer-student-guide
2140 api developer-student-guide2140 api developer-student-guide
2140 api developer-student-guide
Darko Gicevski
 
Tech talk live on new alfresco api
Tech talk live on new alfresco apiTech talk live on new alfresco api
Tech talk live on new alfresco api
Alfresco Software
 
Alfresco Share Customization Made Easy With Side Labs
Alfresco Share Customization Made Easy With Side LabsAlfresco Share Customization Made Easy With Side Labs
Alfresco Share Customization Made Easy With Side Labs
Alfresco Software
 

En vedette (9)

2140 api developer-student-guide
2140 api developer-student-guide2140 api developer-student-guide
2140 api developer-student-guide
 
Tech talk live on new alfresco api
Tech talk live on new alfresco apiTech talk live on new alfresco api
Tech talk live on new alfresco api
 
Alfresco Share Customization Made Easy With Side Labs
Alfresco Share Customization Made Easy With Side LabsAlfresco Share Customization Made Easy With Side Labs
Alfresco Share Customization Made Easy With Side Labs
 
Alfresco tech talk live public api episode 64
Alfresco tech talk live public api episode 64Alfresco tech talk live public api episode 64
Alfresco tech talk live public api episode 64
 
Alfresco Day Vienna 2016: Alfrescos neue Rest API
Alfresco Day Vienna 2016: Alfrescos neue Rest APIAlfresco Day Vienna 2016: Alfrescos neue Rest API
Alfresco Day Vienna 2016: Alfrescos neue Rest API
 
Installing and Getting Started with Alfresco
Installing and Getting Started with AlfrescoInstalling and Getting Started with Alfresco
Installing and Getting Started with Alfresco
 
Intro to Alfresco for Developers
Intro to Alfresco for DevelopersIntro to Alfresco for Developers
Intro to Alfresco for Developers
 
Getting Started with CMIS
Getting Started with CMISGetting Started with CMIS
Getting Started with CMIS
 
Alfresco In An Hour - Document Management, Web Content Management, and Collab...
Alfresco In An Hour - Document Management, Web Content Management, and Collab...Alfresco In An Hour - Document Management, Web Content Management, and Collab...
Alfresco In An Hour - Document Management, Web Content Management, and Collab...
 

Similaire à Intro to the Alfresco Public API

Similaire à Intro to the Alfresco Public API (20)

Building Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco APIBuilding Content-Rich Java Apps in the Cloud with the Alfresco API
Building Content-Rich Java Apps in the Cloud with the Alfresco API
 
Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...
Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...
Alfresco Coding mit dem Alfresco SDK (auf Englisch) - Julien Bruinaud, Techni...
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
API Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIsAPI Services: Building State-of-the-Art APIs
API Services: Building State-of-the-Art APIs
 
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM BluemixDeploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
Deploy and Access WebSphere Liberty and StrongLoop REST Endpoints on IBM Bluemix
 
Day 1 axway apim-training
Day 1   axway apim-trainingDay 1   axway apim-training
Day 1 axway apim-training
 
API SECURITY
API SECURITYAPI SECURITY
API SECURITY
 
Alfresco for Salesforce
Alfresco for SalesforceAlfresco for Salesforce
Alfresco for Salesforce
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhuapidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
apidays LIVE Hong Kong - Orchestrating APIs at Scale by Hieu Nguyen Nhu
 
Developing Apps with Azure AD
Developing Apps with Azure ADDeveloping Apps with Azure AD
Developing Apps with Azure AD
 
Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014 Apigility – Lightning Fast API Development - OSSCamp 2014
Apigility – Lightning Fast API Development - OSSCamp 2014
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
 
Design & Deploy a data-driven Web API in 2 hours
Design & Deploy a data-driven Web API in 2 hoursDesign & Deploy a data-driven Web API in 2 hours
Design & Deploy a data-driven Web API in 2 hours
 
Aws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API GatewayAws Technical Day 2015 - Amazon API Gateway
Aws Technical Day 2015 - Amazon API Gateway
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Apache Cordova 4.x
Apache Cordova 4.xApache Cordova 4.x
Apache Cordova 4.x
 
DreamFactory Essentials Webinar
DreamFactory Essentials WebinarDreamFactory Essentials Webinar
DreamFactory Essentials Webinar
 
Build your APIs with apigility
Build your APIs with apigilityBuild your APIs with apigility
Build your APIs with apigility
 
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 minsAWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
AWS Community Day Bangkok 2019 - Build a Serverless Web Application in 30 mins
 

Plus de Jeff Potts

Alfresco Community Survey 2012 Results
Alfresco Community Survey 2012 ResultsAlfresco Community Survey 2012 Results
Alfresco Community Survey 2012 Results
Jeff Potts
 
Alfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & IntegrationsAlfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & Integrations
Jeff Potts
 

Plus de Jeff Potts (20)

No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with Ansible
 
Moving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to MicroservicesMoving From Actions & Behaviors to Microservices
Moving From Actions & Behaviors to Microservices
 
Flexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL TemplatesFlexible Permissions Management with ACL Templates
Flexible Permissions Management with ACL Templates
 
Moving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco RepositoryMoving Gigantic Files Into and Out of the Alfresco Repository
Moving Gigantic Files Into and Out of the Alfresco Repository
 
Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?Could Alfresco Survive a Zombie Attack?
Could Alfresco Survive a Zombie Attack?
 
Connecting Content Management Apps with CMIS
Connecting Content Management Apps with CMISConnecting Content Management Apps with CMIS
Connecting Content Management Apps with CMIS
 
The Challenges of Keeping Bees
The Challenges of Keeping BeesThe Challenges of Keeping Bees
The Challenges of Keeping Bees
 
Getting Started With CMIS
Getting Started With CMISGetting Started With CMIS
Getting Started With CMIS
 
Alfresco: What every developer should know
Alfresco: What every developer should knowAlfresco: What every developer should know
Alfresco: What every developer should know
 
CMIS: An Open API for Managing Content
CMIS: An Open API for Managing ContentCMIS: An Open API for Managing Content
CMIS: An Open API for Managing Content
 
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
Apache Chemistry in Action: Using CMIS and your favorite language to unlock c...
 
Alfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM MarketAlfresco: The Story of How Open Source Disrupted the ECM Market
Alfresco: The Story of How Open Source Disrupted the ECM Market
 
Join the Alfresco community
Join the Alfresco communityJoin the Alfresco community
Join the Alfresco community
 
Apache Chemistry in Action
Apache Chemistry in ActionApache Chemistry in Action
Apache Chemistry in Action
 
Alfresco Community Survey 2012 Results
Alfresco Community Survey 2012 ResultsAlfresco Community Survey 2012 Results
Alfresco Community Survey 2012 Results
 
Relational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric AppsRelational Won't Cut It: Architecting Content Centric Apps
Relational Won't Cut It: Architecting Content Centric Apps
 
Alfresco SAUG: State of ECM
Alfresco SAUG: State of ECMAlfresco SAUG: State of ECM
Alfresco SAUG: State of ECM
 
Alfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & IntegrationsAlfresco SAUG: CMIS & Integrations
Alfresco SAUG: CMIS & Integrations
 
Should You Attend Alfresco Devcon 2011
Should You Attend Alfresco Devcon 2011Should You Attend Alfresco Devcon 2011
Should You Attend Alfresco Devcon 2011
 
2011 Alfresco Community Survey Results
2011 Alfresco Community Survey Results2011 Alfresco Community Survey Results
2011 Alfresco Community Survey Results
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Intro to the Alfresco Public API

  • 1. Intro to the Alfresco Public API Jeff Potts Chief Community Officer
  • 2. Doesn’t Alfresco already have an API? Yes, but… • Not really public (things change) • Not versioned • Not well documented • Doesn’t work for cloud The Alfresco Public API addresses these limitations Vision is to have a single API that works across cloud and on-premise
  • 4.
  • 5.
  • 6. Folder, file, content and metadata manipulation and search Networks, sites, people, comments, tags, activities, …
  • 7. Getting Started 1. Understand OAuth2 2. Register your app 3. Grab a client-side CMIS library • Or an SDK if coding a mobile app 4. Start coding!
  • 8. Step 1: Groking OAuth2 Defined in RFC-6749 Secure authentication • 3rd party apps don’t ever see the user’s password Unambiguously identifies: • API provider (e.g. Alfresco) • Client application (e.g. your application) • End-user (e.g. an Alfresco Cloud user)
  • 9. OAuth2 & Alfresco Used to secure the Alfresco API Only authentication mechanism provided for APIs in Alfresco Cloud
  • 10. Registering an App Application Developer Alfresco Developer Portal Creates developer profile Assigns an API key and secret for that app Signs up on developer portal Registers an application
  • 11. Authorization Application Alfresco End-User Links to Alfresco authorization page, passing API key & secret Asks the user to authorize the app User authorizes the app to access their account Redirects to your app’s callback URL, passing authorization code Exchanges the authorization code for an access token Returns access and refresh tokens Securely persists the access and refresh token for that user
  • 12. Making API Calls Calls APIs, passing the access token in the Authorization HTTP header Identifies user from access token, executes API call Application Alfresco
  • 13. Refresh Flow Calls APIs, passing the access token in the Authorization HTTP header Returns 401 error, indicating access token has expired Refreshes access token, passing refresh token Returns new access token Application Alfresco
  • 14. OAuth2 library can hide details Spring Social http://www.springsource.org/spring-social Google OAuth2 Client https://developers.google.com/accounts/doc s/OAuth2#libraries
  • 15. Step 2: Register Your App http://www.alfresco.com/develop • Alfresco Cloud Account • Registered Developer Account Add as many applications as you want Key, secret, callback URL
  • 16. Step 3: CMIS Library Apache Chemistry is the umbrella project for all CMIS related projects at the ASF • OpenCMIS (Java, client and server) • cmislib (Python, client) • phpclient (PHP, client) • DotCMIS (.NET, client) • ObjectiveCMIS (Objective-C) Other client libraries exist
  • 18. Create, Find, & Comment http://youtu.be/1ZtmoPdCKJI
  • 19. Alfresco API URLs Structure: • Tenant • API scope • API name • API version • Entity type https://api.alfresco.com/ * The notion of entity types doesn’t apply to CMIS. * public/acme.com/ sitesalfresco/versions/1/
  • 20. Entity type collections The entity type URL represents a collection of all instances of that entity • The collection may or may not be retrievable via a GET Each instance of an entity can be accessed via the collection URL with an Id appended .../acme.com/public/alfresco/versions/1/sites/mullet-gallery
  • 21. Top level entity types sites people tags nodes favorites
  • 22. Nesting entity types Entity types may also be nested The same rule about retrieving instances by Id applies .../acme.com/public/alfresco/versions/1/sites/mullet-gallery/members .../acme.com/public/alfresco/versions/1/sites/mullet- gallery/members/pmonks@alfresco.com
  • 23. Create, update, & delete Creating a new entity instance: • POST to the collection URL Updating an entity instance: • PUT to the instance URL Deleting an entity instance: • DELETE against the instance URL These rules apply regardless of whether it’s a top-level or nested collection
  • 24. Considerations Rate limits • 5 requests/second, 10,000 requests/day (Dev) • 50 requests/second, 100,000 requests/day (Prod) No limit on # of applications Alfresco Cloud users own their content >= OpenCMIS 0.8.0-SNAPSHOT >= cmislib 0.5.1dev
  • 25. Roadmap Merge APIs into Alfresco Enterprise v4.2 New API types: • User Provisioning (SCIM) • Workflow (Activiti) New API versions: • CMIS v1.1 • Alfresco v2 (?) New Alfresco API entity types: • renditions • bulk-imports (?)
  • 26. Roadmap Binary property support Projection & transclusion improvements (“SELECT”) Restriction improvements (“WHERE”) Discoverability improvements • In support of “executable documentation”
  • 27. Getting Help Docs: http://www.alfresco.com/develop Resources: • Alfresco API forum • #alfresco on freenode IRC • Alfresco Technical Discussion Google Group Source Code: • Code from DevCon Session • Spring Social Alfresco Library • Peter’s Grails Example • Jeff’s Java Examples & Python Examples
  • 28. Read the book! Everything you need to know about CMIS 1.0 & 1.1 Lots of Groovy and Java examples Also covers Python, Android, & iOS Now on MEAP! 37%-off: 12cmisal
  • 29. The keys to one badass ECM platform are yours for the taking http://www.alfresco.com/develop http://www.flickr.com/photos/ph-stop/3101407532/

Notes de l'éditeur

  1. REST API includes:SitesMembersFavoritesNetworksPeopleContainersActivitiesRatingsCommentsTags
  2. PETER
  3. PETER
  4. PETER
  5. PETER
  6. PETER
  7. PETER
  8. PETER