Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #35 from funkyboy/master

New format for documentation
  • Loading branch information...
commit 60d7af6e6dc6a906654d6c526273dc8066616017 2 parents bca9c77 + c9a6c62
@funkyboy funkyboy authored
Showing with 6,147 additions and 18,650 deletions.
  1. BIN  .DS_Store
  2. +0 −1  .gitignore
  3. +0 −73 Advanced/hacking.rst
  4. +0 −7 Advanced/index.rst
  5. +29 −0 Gemfile
  6. +13 −0 LICENSE
  7. +0 −153 Makefile
  8. +5 −0 README.md
  9. +3 −0  Rakefile
  10. BIN  RestAPI/.DS_Store
  11. BIN  RestAPI/Admin/.DS_Store
  12. +0 −10 RestAPI/Admin/admin_application_settings.rst
  13. +0 −156 RestAPI/Admin/admin_assets.rst
  14. +0 −55 RestAPI/Admin/admin_collections.rst
  15. +0 −99 RestAPI/Admin/admin_database_management.rst
  16. +0 −21 RestAPI/Admin/admin_system_metrics.rst
  17. +0 −62 RestAPI/Admin/admin_users.rst
  18. +0 −12 RestAPI/Admin/index.rst
  19. BIN  RestAPI/Users/.DS_Store
  20. +0 −9 RestAPI/Users/index.rst
  21. +0 −188 RestAPI/Users/social_login.rst
  22. +0 −446 RestAPI/Users/users.rst
  23. +0 −40 RestAPI/assets.rst
  24. +0 −433 RestAPI/documents.rst
  25. +0 −233 RestAPI/file.rst
  26. +0 −123 RestAPI/general_remarks.rst
  27. +0 −15 RestAPI/index.rst
  28. +0 −79 RestAPI/push_notifications.rst
  29. +0 −129 RestAPI/settings.rst
  30. BIN  SDK/.DS_Store
  31. BIN  SDK/Android/.DS_Store
  32. +0 −7 SDK/Android/index.rst
  33. +0 −195 SDK/Android/user_guide_android.rst
  34. BIN  SDK/iOS/.DS_Store
  35. +0 −401 SDK/iOS/getting_started_ios.rst
  36. +0 −6 SDK/iOS/index.rst
  37. +0 −463 SDK/iOS/ios_sdk.rst
  38. +0 −215 SDK/iOS/user_guide_ios.rst
  39. +0 −10 SDK/index.rst
  40. BIN  _static/.DS_Store
  41. BIN  _static/Console_0.6.0/53083208c1f7f299a1b60a634a9d2a09.media.600x402.png
  42. BIN  _static/Console_0.6.0/76043bc4472533574babeb222c1c55cc.media.1024x534.png
  43. BIN  _static/Console_0.6.0/assets.png
  44. BIN  _static/Console_0.6.0/baasbox-db-management.png
  45. BIN  _static/Console_0.6.0/baasbox-documents-table.png
  46. BIN  _static/Console_0.6.0/baasbox_0-6-0-console.png
  47. BIN  _static/Console_0.6.0/collections.png
  48. BIN  _static/Console_0.6.0/create_new_collection.png
  49. BIN  _static/Console_0.6.0/create_new_user.png
  50. BIN  _static/Console_0.6.0/documents.png
  51. BIN  _static/Console_0.6.0/edit_settings.png
  52. BIN  _static/Console_0.6.0/f3655beefd279784e9d888ddacec2737.media.600x319.png
  53. BIN  _static/Console_0.6.0/home_console.png
  54. BIN  _static/Console_0.6.0/login.png
  55. BIN  _static/Console_0.6.0/new_asset.png
  56. BIN  _static/Console_0.6.0/news.png
  57. BIN  _static/Console_0.6.0/users.png
  58. BIN  _static/Console_0.7.2/.DS_Store
  59. BIN  _static/Console_0.7.3/.DS_Store
  60. BIN  _static/Console_0.7.3/baasbox_console.png
  61. BIN  _static/Social-Login/.DS_Store
  62. BIN  _static/Social-Login/Tutorial/.DS_Store
  63. BIN  _static/Social-Login/Tutorial/img1.png
  64. BIN  _static/Social-Login/Tutorial/img10.png
  65. BIN  _static/Social-Login/Tutorial/img11.png
  66. BIN  _static/Social-Login/Tutorial/img12.png
  67. BIN  _static/Social-Login/Tutorial/img13.png
  68. BIN  _static/Social-Login/Tutorial/img14.png
  69. BIN  _static/Social-Login/Tutorial/img1_bck.png
  70. BIN  _static/Social-Login/Tutorial/img2.png
  71. BIN  _static/Social-Login/Tutorial/img3.png
  72. BIN  _static/Social-Login/Tutorial/img5.png
  73. BIN  _static/Social-Login/Tutorial/img6.png
  74. BIN  _static/Social-Login/Tutorial/img7.png
  75. BIN  _static/Social-Login/Tutorial/img8.png
  76. BIN  _static/Social-Login/Tutorial/img9.png
  77. BIN  _static/Social-Login/img1.png
  78. BIN  _static/Social-Login/img2.png
  79. BIN  _static/Tutorial/.DS_Store
  80. BIN  _static/Tutorial/Dear_diary/.DS_Store
  81. BIN  _static/Tutorial/Dear_diary/001-DearDiary_add-new-memo.png
  82. BIN  _static/Tutorial/Dear_diary/001-DearDiary_dashboard-baasbox.png
  83. BIN  _static/Tutorial/Dear_diary/001-DearDiary_edit-title-body.png
  84. BIN  _static/Tutorial/Dear_diary/001-DearDiary_import-sdk-ios-0-1-5.png
  85. BIN  _static/Tutorial/Dear_diary/001-DearDiary_launch-baasbox.png
  86. BIN  _static/Tutorial/Dear_diary/001-DearDiary_login-baasbox.png
  87. BIN  _static/Tutorial/Dear_diary/001-DearDiary_new-collection-baasbox.png
  88. BIN  _static/Tutorial/Dear_diary/001-DearDiary_see-post-collections-dashboard.png
  89. BIN  _static/Tutorial/Dear_diary/001-DearDiary_signup-login.png
  90. +0 −3  _static/default.css
  91. +0 −13 _themes/.gitignore
  92. +0 −181 _themes/baasbox/layout.html
  93. +0 −5 _themes/baasbox/searchbox.html
  94. +0 −115 _themes/baasbox/static/css/background-image.css
  95. +0 −184 _themes/baasbox/static/css/background-image.less
  96. +0 −120 _themes/baasbox/static/css/background-pattern.css
  97. +0 −180 _themes/baasbox/static/css/background-pattern.less
  98. +0 −1,824 _themes/baasbox/static/css/basic.css
  99. +0 −1,838 _themes/baasbox/static/css/basic.less
  100. +0 −52 _themes/baasbox/static/css/ie.css
  101. +0 −127 _themes/baasbox/static/css/ie.less
  102. +0 −1  _themes/baasbox/static/css/theme.css
  103. +0 −1,203 _themes/baasbox/static/font-awesome/css/font-awesome-ie7.css
  104. +0 −384 _themes/baasbox/static/font-awesome/css/font-awesome-ie7.min.css
  105. +0 −1,487 _themes/baasbox/static/font-awesome/css/font-awesome.css
  106. +0 −403 _themes/baasbox/static/font-awesome/css/font-awesome.min.css
  107. BIN  _themes/baasbox/static/font-awesome/font/FontAwesome.otf
  108. BIN  _themes/baasbox/static/font-awesome/font/fontawesome-webfont.eot
  109. +0 −399 _themes/baasbox/static/font-awesome/font/fontawesome-webfont.svg
  110. BIN  _themes/baasbox/static/font-awesome/font/fontawesome-webfont.ttf
  111. BIN  _themes/baasbox/static/font-awesome/font/fontawesome-webfont.woff
  112. BIN  _themes/baasbox/static/img/background/background-image.jpg
  113. BIN  _themes/baasbox/static/img/background/wood_pattern.png
  114. BIN  _themes/baasbox/static/img/home/home_phone.png
  115. BIN  _themes/baasbox/static/img/home/home_tablet.png
  116. BIN  _themes/baasbox/static/img/home/phone-display.png
  117. BIN  _themes/baasbox/static/img/home/tablet-display.png
  118. BIN  _themes/baasbox/static/img/partners/partner1.png
  119. BIN  _themes/baasbox/static/img/partners/partner2.png
  120. BIN  _themes/baasbox/static/img/partners/partner3.png
  121. BIN  _themes/baasbox/static/img/partners/partner4.png
  122. BIN  _themes/baasbox/static/img/partners/partner5.png
  123. BIN  _themes/baasbox/static/img/slider/appstore.png
  124. BIN  _themes/baasbox/static/img/slider/googleplay.png
  125. BIN  _themes/baasbox/static/img/slider/slider_phone.png
  126. BIN  _themes/baasbox/static/img/slider/slider_phone2.png
  127. BIN  _themes/baasbox/static/img/slider/slider_phone3.png
  128. BIN  _themes/baasbox/static/img/team/designer.png
  129. BIN  _themes/baasbox/static/img/team/developer.png
  130. BIN  _themes/baasbox/static/img/team/director.png
  131. BIN  _themes/baasbox/static/img/team/seo.png
  132. +0 −12 _themes/baasbox/static/js/map.js
  133. +0 −165 _themes/baasbox/static/js/script.js
  134. +0 −7 _themes/baasbox/theme.conf
  135. +0 −37 _themes/baasbox/versions.html
  136. +0 −17 _themes/sphinx_rtd_theme/__init__.py
  137. +0 −6 _themes/sphinx_rtd_theme/breadcrumbs.html
  138. +0 −3  _themes/sphinx_rtd_theme/download.html
  139. +0 −30 _themes/sphinx_rtd_theme/footer.html
  140. +0 −138 _themes/sphinx_rtd_theme/layout.html
  141. +0 −205 _themes/sphinx_rtd_theme/layout_old.html
  142. +0 −50 _themes/sphinx_rtd_theme/search.html
  143. +0 −6 _themes/sphinx_rtd_theme/searchbox.html
  144. +0 −1  _themes/sphinx_rtd_theme/static/css/badge_only.css
  145. +0 −3,741 _themes/sphinx_rtd_theme/static/css/theme.css
  146. BIN  _themes/sphinx_rtd_theme/static/font/fontawesome_webfont.eot
  147. +0 −399 _themes/sphinx_rtd_theme/static/font/fontawesome_webfont.svg
  148. BIN  _themes/sphinx_rtd_theme/static/font/fontawesome_webfont.ttf
  149. BIN  _themes/sphinx_rtd_theme/static/font/fontawesome_webfont.woff
  150. +0 −3  _themes/sphinx_rtd_theme/static/js/theme.js
  151. +0 −7 _themes/sphinx_rtd_theme/theme.conf
  152. +0 −26 _themes/sphinx_rtd_theme/versions.html
  153. +0 −194 access_log
  154. +0 −191 agent_log
  155. +0 −24 assets.rst
  156. +0 −245 conf.py
  157. +36 −0 config.rb
  158. +0 −181 console.rst
  159. +0 −16 custom_error_code.rst
  160. 0  error_log
  161. +0 −60 general_overview.rst
  162. +0 −77 hacking.rst
  163. +0 −59 index.rst
  164. +0 −29 installation.rst
  165. +0 −28 introduction.rst
  166. +0 −190 make.bat
  167. +0 −66 push_notifications.rst
  168. +0 −141 referer_log
  169. +0 −121 setting.rst
  170. BIN  source/fonts/icomoon.eot
  171. +17 −0 source/fonts/icomoon.svg
  172. BIN  source/fonts/icomoon.ttf
  173. BIN  source/fonts/icomoon.woff
  174. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/assets.png
  175. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/baasbox-db-management.png
  176. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/baasbox-documents-table.png
  177. 0  {_static → source/images}/Console_0.7.2/baasbox_0-7-2-console.png
  178. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/collections.png
  179. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/create_new_collection.png
  180. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/create_new_user.png
  181. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/documents.png
  182. 0  {_static → source/images}/Console_0.7.2/home_console.png
  183. BIN  source/images/Console_0.7.2/image_resize.png
  184. 0  {_static → source/images}/Console_0.7.2/login.png
  185. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/new_asset.png
  186. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/news.png
  187. 0  {_static → source/images}/Console_0.7.2/settings.png
  188. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/social_login1.png
  189. 0  {_static/Console_0.7.3 → source/images/Console_0.7.2}/social_login2.png
  190. 0  {_static → source/images}/Console_0.7.2/users.png
  191. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/assets.png
  192. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/baasbox-db-management.png
  193. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/baasbox-documents-table.png
  194. 0  {_static → source/images}/Console_0.7.3/baasbox_0-7-3-console.png
  195. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/collections.png
  196. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/create_new_collection.png
  197. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/create_new_user.png
  198. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/documents.png
  199. 0  {_static → source/images}/Console_0.7.3/home_console.png
  200. 0  {_static → source/images}/Console_0.7.3/login.png
  201. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/new_asset.png
  202. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/news.png
  203. 0  {_static → source/images}/Console_0.7.3/settings.png
  204. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/social_login1.png
  205. 0  {_static/Console_0.7.2 → source/images/Console_0.7.3}/social_login2.png
  206. 0  {_static → source/images}/Console_0.7.3/users.png
  207. BIN  source/images/logo.png
  208. +3,599 −0 source/index.md
  209. +2 −0  source/javascripts/all.js
  210. +1,025 −0 source/javascripts/jquery.tocify.js
  211. +6 −0 source/javascripts/jquery_ui.js
  212. +52 −0 source/javascripts/lang_selector.js
  213. +127 −0 source/layouts/layout.erb
  214. +95 −0 source/stylesheets/fix.css
  215. +50 −0 source/stylesheets/icon-font.scss
  216. +375 −0 source/stylesheets/normalize.css
  217. +110 −0 source/stylesheets/print.css.scss
  218. +470 −0 source/stylesheets/screen.css.scss
  219. +27 −0 source/stylesheets/syntax.css.scss.erb
  220. +106 −0 source/stylesheets/variables.scss
  221. +0 −15 tutorial.rst
View
BIN  .DS_Store
Binary file not shown
View
1  .gitignore
@@ -1 +0,0 @@
-_build/
View
73 Advanced/hacking.rst
@@ -1,73 +0,0 @@
-Hacking
-=======
-
-You can override many default value and options by providing them to the
-JVM. To do so, you have to use the **-D** parameter in this way
-
-::
-
- ./start -DBAASBOX_PARAMETER=NEW_VALUE
-
-Where *BAASBOX*\ PARAMETER\_ is the key of the parameter to override and
-*NEW*\ VALUE\_ is the value you want to use. Please note that there is
-no space between the D and the name parameter. Overridable keys are:
-
-+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
-| Key | Description | Example |
-+=======================+==================================================================================================================================================================================================+========================================================================================+
-| http.port | The port used by BaasBox | -Dhttp.port=80 |
-+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
-| https.port | The SSL port used by BaasBox. By default SSL is disabled | -Dhttp.port=443 |
-+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
-| application.code | Your Application Code. You should override the default one and choose a very unique code | -Dapplication.code=Zh54re3 |
-+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
-| orient.baasbox.path | The path of the embedded database. By default this is {BAASBOX\_HOME/db/baasbox} | -Dorient.baasbox.path=./mydb |
-+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
-| logger.application | The default level of the logger. By default is DEBUG. Possible values are ERROR, WARNING, INFO, DEBUG, TRACE | -Dlogger.application=INFO |
-+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
-| config.file | An external configuration file. You can put all your parameters in a file. This file **MUST** include the **include classpath("application.conf")** directive, otherwise BaasBox will not work | -Dconfig.file=baasbox.config then you have to create a file named **baasbox.config** |
-+-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------+
-
-Regarding the config.file key, a possible example of an external
-configuration file may be:
-
-::
-
- include classpath("application.conf")
- application.code="1234-56789"
- orient.baasbox.path=db/baasbox
- logger.application=DEBUG
-
-The Play! Framework
-~~~~~~~~~~~~~~~~~~~
-
-BaasBox is built on top of [[Play!
-Framework\|http://www.playframework.com/]]. Because of this you have to
-download a [[JDK 6 or
-above\|http://www.oracle.com/technetwork/java/javase/downloads/index.html]]
-N.B.(JDK not JRE!) and [[Play!
-2.1.1\|http://www.playframework.com/download]] at this link, and install
-them following their installation guides. You must also download the
-BaasBox source code source from its [[GitHub
-Repo\|https://github.com/baasbox/baasbox]]. Once all the required
-software is correctly installed, and the BaasBox source code is in a
-convenient directory, go to that directory and type **play dist**\
-
-After a while, Play! ends to build the application and a new ./dist
-directory is created in the unzipped BaasBox source code path. In the
-new ./dist directory you will find a zip file containing the compiled
-code. To test it, unzip it in any directory and type ./start (remember
-to set the execution flag). If you are using a Windows system, you need
-a .bat file. Just create a new start.bat file and place the following
-line in it: \*\*java %1 -cp “./lib/\*;”
-play.core.server.NettyServer.\*\*
-
-(Pay attention to to the final dot)
-
-Since BaasBox is based upon the [[Play! Framework
-2.1\|http://www.playframework.com/download]], many configuration options
-available by Play! could be used with BaasBox. Please refer to the
-[[Play!
-documentation\|http://www.playframework.com/documentation/2.1.x/Configuration]]
-to know how to perform such operations and to customize the default
-behavior.
View
7 Advanced/index.rst
@@ -1,7 +0,0 @@
-Contents:
-
-ADVANCED
--------
-.. toctree::
-
- hacking
View
29 Gemfile
@@ -0,0 +1,29 @@
+# If you have OpenSSL installed, we recommend updating
+# the following line to use "https"
+source 'http://rubygems.org'
+
+gem "middleman", "~>3.2.0"
+
+# For syntax highlighting
+gem "middleman-syntax"
+
+# Plugin for middleman to generate Github pages
+gem 'middleman-gh-pages'
+
+# Live-reloading plugin
+gem "middleman-livereload", "~> 3.1.0"
+
+gem 'redcarpet', :git => 'https://github.com/vmg/redcarpet.git'
+
+# For faster file watcher updates on Windows:
+gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
+
+# Failed to start middleman without this
+gem "therubyracer"
+
+# Cross-templating language block fix for Ruby 1.8
+platforms :mri_18 do
+ gem "ruby18_source_location"
+end
+
+gem "rake", "~> 10.1.0"
View
13 LICENSE
@@ -0,0 +1,13 @@
+Copyright 2008-2013 Concur Technologies, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may
+not use this file except in compliance with the License. You may obtain
+a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+License for the specific language governing permissions and limitations
+under the License.
View
153 Makefile
@@ -1,153 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
-
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
-
-help:
- @echo "Please use \`make <target>' where <target> is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
-
-clean:
- -rm -rf $(BUILDDIR)/*
-
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/baasbox.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/baasbox.qhc"
-
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/baasbox"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/baasbox"
- @echo "# devhelp"
-
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
View
5 README.md
@@ -0,0 +1,5 @@
+docs
+====
+
+BaasBox documentation
+See: [http://www.baasbox.com/documentation](http://www.baasbox.com/documentation)
View
3  Rakefile
@@ -0,0 +1,3 @@
+require 'middleman-gh-pages'
+
+task :default => [:build]
View
BIN  RestAPI/.DS_Store
Binary file not shown
View
BIN  RestAPI/Admin/.DS_Store
Binary file not shown
View
10 RestAPI/Admin/admin_application_settings.rst
@@ -1,10 +0,0 @@
-Application Settings
-================
-
-These APIs can be used to set some internal settings.
-
-Note that many of
-these settings are App-related and do not affect server behavior or
-configuration (like for example the listening port). Server related
-settings must be configured via configuration file, or by hacking the
-start script.
View
156 RestAPI/Admin/admin_assets.rst
@@ -1,156 +0,0 @@
-Assets
-======
-
-Assets are a special kind of records. First of all, they can be both files or JSON documents. Furthermore they are accessible by anyone, even without authentication. They are useful to create publicly accessible elements such as, for example, images.
-
-Create an Asset
----------------
-``POST /admin/asset``
-
-**Headers**\ See the :doc:`/RestAPI/general_remarks`
-and:
-
-1. **to create an object (JSON document) asset**\
-
-- **content-type**: x-www-form-urlencoded
-
-2. **to create a file asset**\
-
-- **content-type**: multipart/form-data
-
-**Description**: This API creates a new asset. The user must belong to the admin role.
-
-**Body payload** The body can contain the
-following fields:
-
-- **name**: MANDATORY. The name of the asset.
-- **meta**: optional. A string representing a valid JSON string. Here you can store any data associated with the asset. PAY ATTENTION: since assets are public, everyone could retrieve these data.
-- **file**: optional. If the asset is of the file kind, this is the file you have to load.
-
-**NOTE**: the server automatically detects if you are posting a file or not by the content-type header. So pay attention and set up the correct value.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 403: the user is not an Admin
-- Code 201: Asset created
-
-**Examples**\ Object Asset:
-
-::
-
- curl -d "name=objectAsset&meta={\"name\": \"Pizza\", \"price\": 5, \"ingredients\": [\"Mozzarella\", \"pomodoro\", \"basilico\"]}" --user admin:admin -H X-BAASBOX-APPCODE:1234567890 http://localhost:9000/admin/asset
-
-File Asset:
-
-::
-
- curl --form file=@pizza.jpg --form name=fileAsset --form meta="{\"name\": \"Margherita\", \"price\": 5, \"ingredients\": [\"Mozzarella\", \"pomodoro\", \"basilico\"]}" --user admin:admin -H X-BAASBOX-APPCODE:1234567890 http://localhost:9000/admin/asset
-
-**Note**: in this case the file pizza.jpg is a file that must be into the same directory in which you run the command
-
-Retrieve all the assets
------------------------
-``GET /admin/asset``
-
-**Headers**: See the
-:doc:`/RestAPI/general_remarks`. The user must be an administrator
-
-**Description**: This API returns a JSON describing all the available assets
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 403: the user is not an Admin
-- Code 200: OK. A JSON collection is provided
-
-**Delete an asset**: ``DELETE /admin/asset/:name``
-
-**Headers**: See the
-:doc:`/RestAPI/general_remarks`. The user must be an administrator
-
-**Description**: This API deletes a given asset.
-
-**Parameters**\
-
-- **name**: the name of the asset
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 403: the user is not an Admin
-- Code 200: OK. The asset has been deleted.
-
-
-Resize image
-------------
-**Remark**: These APIs work only if the parameter asset is an image
-
-**Resize the image with a fixed width and height**:``GET /asset/:name/resize/:w/:h``
-
-**Headers**: See the
-:doc:`/RestAPI/general_remarks`. The user must be an administrator
-
-**Description:** Resize image with a specified width and height
-
-**Parameters:**
-
-- name: name of image
-- w: width desired
-- h: height desired
-
-**Returns:**
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 503: the server is too busy, operation not performed.
-- Code 403: the user is not an Admin
-- Code 404: asset not found
-- Code 200: ok and returns the image resized
-
-**Resize the image with a fixed percentual**:``GET /asset/:name/resize/:perc``
-
-**Headers**: See the
-:doc:`/RestAPI/general_remarks`. The user must be an administrator
-
-**Description:** Resize image with a specified percentual
-
-**Parameters:**
-
-- name: name of assets
-- perc: percentual for the image resized
-
-**Returns:**
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 403: the user is not an Admin
-- Code 404: asset not found
-- Code 200: ok and returns the image resized
-
-**Apply a resizeId**:``GET /asset/:name/resizeId/:sizeId``
-
-**Headers**: See the
-:doc:`/RestAPI/general_remarks`. The user must be an administrator
-
-**Description:** applies a resizing which is specified in the settings for the admin dashboard, according to the index that was set as a parameter.
-For example: if the settings are [10%,25%,50%,75%] and you use the following API GET /asset/test/resizeId/1, the name test image will be scaled by 10%
-
-**Parameters:**
-
-- sizeId: the resizing index to be applied.
-
-**Returns:**
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 403: the user is not an Admin
-- Code 404: asset not found
-- Code 200: ok and returns the image resized
-
-
-
-
View
55 RestAPI/Admin/admin_collections.rst
@@ -1,55 +0,0 @@
-Collections
-===========
-
-A collection is a sort of bucket where you can store documents.
-Documents, also known as records, are schema-less, which means that
-there are no constraints on their fields definition or data type.
-
-Soon BaasBox will provide methods to set up a sort of constraint at
-schema level.
-
-The records stored in a collection have a per-user-record-security-level. I.e. each
-record can be accessed only by the user who created them. Of course
-there are APIs to grant or revoke privileges to other users.
-
-Create a new collection
------------------------
-
-``POST /admin/collection/{collection name}``
-
-**Headers**: See :doc:`general_remarks`
-
-**Description**: Creates a new collection with the name specified in
-URL. User must belong
-to the Admin Role. The name of a collection MUST start with an alphabetic character,
-CAN contain any alphanumeric character (Latin letters and Arabic numerals).
-Underscore and dash are also allowed. The name of a collection is treated as case-insensitive.
-
-**Returns**:
-
-* Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-* Code 500: the servers cannot fulfill the request, an internal server error occurred
-* Code 400: collection name is invalid
-* Code 403: the user is not an Admin
-* Code 201: collection created
-
-Delete a collection
--------------------
-
-``DELETE /admin/collection/{collection name}``
-
-**Headers**: See :doc:`general_remarks`
-
-**Description**: Deletes an existing new collection with the name specified in the
-URL. The user calling this API must belong to the Admin Role.
-
-**Warning**: When you delete a collection all the objects stored in it are deleted as well.
-
-**Returns**:
-
-* Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-* Code 500: the servers cannot fulfill the request, an internal server error occurred
-* Code 400: collection name is invalid
-* Code 403: the user is not an Admin
-* Code 201: collection deleted
-
View
99 RestAPI/Admin/admin_database_management.rst
@@ -1,99 +0,0 @@
-DB Management
-=============
-
-Export database
----------------
-
-``POST /admin/db/export``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Generate a full dump of the db in an asynchronous task.
-
-P.S. The async nature of the method DOES NOT ensure the creation of the file.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 404: file not created
-- Code 202: ACCEPTED and returns the filename of the file that will be generated
-
-
-Retrieve all backup files
--------------------------
-``GET /admin/db/export``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Returns the list as a JSON array of all the export files stored into the db export folder
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 200: OK and returns a JSON representation containing the list of files stored in the db backup folder
-
-Retrieve a backup file
----------------
-``GET /admin/db/export/:filename``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Returns a file in the backup folder
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 404: file not present
-- Code 200: OK and returns the stream of the file
-
-Drop a database
----------------
-``DELETE /admin/db/:timeout``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Drops the database with a timeout (if specified) and creates a new clean one (returns to initial stage)
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 200: OK
-
-
-
-Delete a backup file
---------------------
-``DELETE /admin/db/export/:filename``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Deletes an export file from the db backup folder, if it exists
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 404: file not found
-- Code 200: OK: the file was correctly deleted
-
-Import database
----------------
-``POST /admin/db/import``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Uploads a JSON export file and applies it to the db.
-
-**WARNING:** all data on the db will be wiped out before importing
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 200: OK
-
-
View
21 RestAPI/Admin/admin_system_metrics.rst
@@ -1,21 +0,0 @@
-System Metrics
-==============
-
-By calling these APIs it is possible to retrieve information about the
-system and its resources usage
-
-**Retrieve some system statistics**: ``GET
-/admin/dbStatistics``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Returns a set of statistics about DB and
-memory usage. User must belong to the Admin Role
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 403: the user is not an Admin
-- Code 200: OK: JSON object and statistics
View
62 RestAPI/Admin/admin_users.rst
@@ -1,62 +0,0 @@
-Users
-=====
-
-Admin APIs to manage users
-
-**Retrieve all the registered users**: ``GET
-/admin/user``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**QueryString**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Returns a JSON list of all current registered users
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 400: an attempt of potential sql-injection attack has been detected. Check the query string parameters
-- Code 200: OK: Retrieve the list of all users but the default admin user
-
-Admin APIs to manage follow/unfollow
-====================================
-
-**Create a follow relationship**: ``POST /admin/Fw/:follower/to/:tofollow``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Create a follow relationship between user follower and user to follow
-
-**Parameters**:
-
- - follower: user follower
- - tofollow: user to follow
-
-**Returns**:
-
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 404: both or either users do not exist
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 400: user :follow is already a friend of :tofollow
-- Code 400: cannot create followship relationship with internal users
-- Code 200: OK
-
-**Delete a follow relationship**: ``DELETE /admin/Fw/:follower/to/:tofollow``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Description**: Delete a follow relationship between user follower and user to follow
-
-**Parameters**:
-
- - follower: user follower
- - tofollow: user to follow
-
-**Returns**:
-
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 404: user :follower is not a friend of :tofollow
-- Code 404: both or either users do not exist
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 200: OK
View
12 RestAPI/Admin/index.rst
@@ -1,12 +0,0 @@
-Admin
--------
-.. toctree::
- :maxdepth: 6
-
- admin_database_management
- admin_collections
- admin_users
- admin_assets
- admin_application_settings
- admin_system_metrics
-
View
BIN  RestAPI/Users/.DS_Store
Binary file not shown
View
9 RestAPI/Users/index.rst
@@ -1,9 +0,0 @@
-Users
--------
-.. toctree::
- :maxdepth: 6
-
- users
- social_login
-
-
View
188 RestAPI/Users/social_login.rst
@@ -1,188 +0,0 @@
-Social Login
-============
-
-**Available since version 0.7.2**
-
-BaasBox provides an API that allows you to connect/create your users
-through social networks.
-
-BaasBox social API is integrated with the following social networks: -
-Facebook - Google +
-
-We are planning on adding more in the near future.
-
-The use of an API in a client application needs an *appKey* and an
-*appSecret* usually provided by the social network itself. More
-information on how you can get those values can be found here:
-
-- facebook (http://developers.facebook.com/docs/)
-- google+ (http://code.google.com/apis/console)
-
-Once you create your app inside the social network you will have access
-to the *apiKey* / *apiSecret* values; those values must be stored into
-the BaasBox database in order to use BaasBox social feature: you can
-access the social login tab from the settings menu in the admin console.
-
-|Social login tab|\
-
-Then click on the specific social network you are working on and fill in
-the form with the keys and press Save. You can disable the social
-feature for a specific social network by pressing the **disable xxx
-button**
-
-|Disable button|\
-
-Once you have connected to a social network you can use any client
-library to obtain the OAuth tokens for users account, and store them
-with the social API provided by BaasBox.
-
-You can find an application example and tutorial `here http://www.baasbox.com/social-login/`_:
-
-API documentation
------------------
-
-Retrieve all social network connections for connected user
-----------------------------------------------------------
-
-``GET /social``
-
-Headers:
-
-- X-BAASBOX-APPCODE: App Code
-- X-BB-SESSION: Session token for current user
-
-Returns a JSON representation of the social network connected to the
-user along with all the information retrieved at the moment of
-login/linking. An example of the returned data is:
-
-::
-
- data": [
- {
- "username": "xxx",
- "password": null,
- "from": "google",
- "token": "<token>",
- "secret": "<secret>",
- "id": "<userid>",
- "additionalData": {
- "email": "<email>",
- "name": "<name>",
- "avatarUrl": "<avatar>",
- "personal_url": "<personal_url>"
- }
- }
-
-This API should be invoked with a valid X-BB-SESSION header and a valid
-X-BAASBOX-APPCODE header as specified in the authorization section of
-the doc.
-
-This method can be used to retrieve the tokens to post on the social
-network wall using a client SDK provided by the social network itself.
-
-Returns:
-
-- 200 code with a JSON object which data property contains all the
- linked social networks to the current user.
-- 404 code if the user does not have any social network linked to their
- account
-- 401 code (Unauthorized) if one of the mandatory headers are missing
-
-Login a User with a specified social network
---------------------------------------------
-
-``POST /social/:socialNetwork``
-
-Headers: X-BAASBOX-APPCODE = App code
-
-Url parameters
-
-:socialNetwork could be **facebook** or **google**
-
-Parameters:
-
-- oauth\_token: the **oauth\_token** obtained after user authentication
- and authorization with a client library (see example `here http://www.baasbox.com/social-login/`_:)
-
-- oauth\_secret: the **oauth\_secret** obtained after user
- authentication and authorization with a client library (see example
- `here http://www.baasbox.com/social-login/`_:)
-
-This method allows to login into the BaasBox app using the tokens
-obtained by a social network client library. If the user has already
-logged in with same tokens the server will simply return the
-X-BB-SESSION token that will be used for further requests.
-
-If the user does not exist it will be created and an X-BB-SESSION token
-will be returned. Upon user creation some data will be extracted from
-the social network profile and they will be stored inside the user
-object. A username will be uniquely generated (to prevent username
-collision). Therefore after a succesfull login, if necessary, the client
-app may ask for a username and update the user object accordingly.(See
-the example `here http://www.baasbox.com/social-login/`_:)
-
-Returns:
-
-- 200 code with the user's X-BB-SESSION token
-- 400 code if one of the oauth\_token or oauth\_secret was missing
-- 401 code if the X-BAASBOX-APPCODE header was missing
-- 500 code if something on the server went wrong (i.e. another user
- with the same tokens already exists)
-
-Link a user to a specified social network
------------------------------------------
-
-``PUT /social/:socialNetwork``
-
-Headers:
-
-- X-BAASBOX-APPCODE = App code
-- X-BB-SESSION = Session token for the current user
-
-Url parameters
-
-:socialNetwork could be **facebook** or **google**
-
-Parameters: oauth\_token: the **oauth\_token** obtained after user
-authentication and authorization with a client library (see example `here http://www.baasbox.com/social-login/`_:)
-
-oauth\_secret: the **oauth\_secret** obtained after user authentication
-and authorization with a client library (see example `here http://www.baasbox.com/social-login/`_:)
-
-This method allows an existing user to connect their account to a
-specified social network.
-
-This procedure is very similar to the Login method with a difference:
-this is a PUT request and it must be invoked with the X-BB-SESSION
-header.
-
-Returns: a 200 code with an empty response if the linking was succesful, a 401
-code if any of the mandatory headers was missing, a 500 code if something
-on the server went wrong (i.e. another user with the same tokens already
-exists)
-
-Unlink a user from a specified social network
----------------------------------------------
-
-``DELETE /social/:socialNetwork``
-
-Headers:
-
-- X-BAASBOX-APPCODE = App code
-- X-BB-SESSION = Session token for current user
-
-Url parameters :socialNetwork could be **facebook** or **google**
-
-This method unlinks the current user account from a specified social
-network. If the user was generated by a social network login and the
-specified social network is the only one linked to the user, an error
-will be raised (as the user will not be available to connect anymore).
-
-Returns: a 200 code with an empty response if the unlink procedure was
-successful, a 400 code if the user was not linked to specified social
-network, a 401 code (Unauthorized) if any of the mandatory header was
-missing, a 500 code if something on the server went wrong (i.e. the user
-was generated and it had only a connection with a social network)
-
-.. |Social login tab| image:: /../../_static/Social-Login/img1.png
-.. |Disable button| image:: /../../_static/Social-Login/img2.png
View
446 RestAPI/Users/users.rst
@@ -1,446 +0,0 @@
-Users
-============
-
-Create a user
-----------------
-
-``POST /user``
-
-**Headers**: See authorization header in the :doc:`/RestAPI/general_remarks`
-
-**Description**: This API allows a user to
-sign up to the App. Users will belong to the registereduser role and
-they will post new content, will retrieve their own content, will change
-their password.
-
-**Body payload**\ A JSON object like this:
-
-
-::
-
- {
-
- "username":"{username}",
-
- "password":"{password}",
-
- "visibleByTheUser": {...},
-
- "visibleByFriend": {...},
-
- "visibleByRegisteredUsers": {..},
-
- "visibleByAnonymousUsers": {...}
-
- }
-
-- **username** and **password** fields are mandatory.
-- **visibleByTheUser** is an object whose fields are private and
- visible only by the user
-- **visibleByFriend** is an object whose fields are visible by the user
- and his/her friends (for future friendship management)
-- **visibleByRegisteredUsers** is an object whose fields are visible by
- the user, his/her friends, any registered user
-- **visibleByAnonymousUsers** is an object whose fields are public and
- visible by everyone, even anonymous users
-
-**Returns**:
-
-- Code 400: ‘username’ or ‘password’ fields are missing
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 201: user created
-
-User Login (Sign in)
---------------------
-
-``POST /login``
-
-**Headers**: Content-Type: application/x-www-form-urlencoded
-
-**Description**: Checks username/password and grants the user the right
-
-to execute other calls. This API returns a session token that must be
-provided into subsequent calls.
-
-**Body payload**\
-
-username={username}&password={password}&appcode={appcode}&login\_data={“os”:”{ios\|android}”,
-“deviceId”:”{……..}”}
-
-- **username**: mandatory. The username of the user
-- **password**: mandatory. The user’s password
-- **appcode**: mandatory. The APP CODE (by default it is 1234567890)
-- **login\_data**: optional. It may contain relevant information about
- user device, used to send him push notification. The login\_data
- field, if present, must be a valid JSON object containing two fields:
- os to specify the device operating system, and deviceId which is the
- device id provided by Apple or Google when the App requires to handle
- their push notification (see tutorials to know how to request it). os
- could be both ios for ios (Apple) devices, or android for Android
- (Google) devices.
-
-**Example of valid login\_data content is**:
-
-::
-
- {
-
- "os":"android",
-
- "deviceId":"xxxxxxxxxxxxxx"
-
- }
-
-Note that in this way a user could login from different devices at the
-same time.
-
-**Returns**:
-
-- Code 500: the server cannot fulfill the request, an internal server
- error occurred
-- Code 401: user unauthorized to perform the operation
-- Code 400: ‘username’, ‘password’ or ‘appcode’ field is missing
-- Code 200: OK. The server replies with a JSON object containing the
- X-BB-SESSION field which is the session token to use in subsequent
- requests as a request header
-
-
-::
-
- {
-
- "result": "ok",
-
- "http_code": 200,
-
- "data": {
-
- "X-BB-SESSION": "9b3c7234-e0eb-4861-8a25-6874d232efd0"
-
- }
-
- }
-
-Note that if not used the token will expire in 15 minutes. In that case
-a new login must be performed. The token expiration does not delete the
-device ID info so the user may continue to receive push notifications.
-
-
-User Logout
-------------
-
-``POST /logout``
-
-**Headers**: X-BB-SESSION: The Session Token
-
- - X-BB-SESSION must contain the session token provided by the login API
-
-**Description**: This API allows a user to logout from the App
-
-**Returns**:
-
-- Code 500: the server cannot fulfill the request, an internal server
- error occurred
-- Code 400: The session token is malformed or expired, the server
- cannot retrieve the App Code associated
-- Code 200: OK. the user has successfully logged out.
-
-
-``POST /logout/:deviceId``
-
-**Headers**: X-BB-SESSION: The Session Token
-
- - X-BB-SESSION must contain the session token provided by the login API
-
-**Parameters**\
-
- - deviceId: the deviceId used in the login API
-
-**Description**: This API allows a user to logout from the App on a
-specific device. Push notification will not be sent to the user through
-the specified device.
-
-**Returns**:
-
-- Code 500: the server cannot fulfill the request, an internal server
- error occurred
-- Code 400: The session token is malformed or expired, the server
- cannot retrieve the App Code associated
-- Code 200: OK. the user has successfully logged out. The
- associated device has been removed.
-
-Password Reset
---------------
-
-``GET /user/:username/password/reset``
-
-**Headers**: X-BAASBOX-APPCODE: The App Code
-
-**Parameters**\
-
-- **username**: the username of the user who wants to reset the
- password
-
-**Description**: Allows to reset a user password. This API is useful
-when a user forgot their password and needs to reset it. In order to
-work, this function needs an email field to be present with a valid
-email addressthat in the visibleByTheUser field of the user profile.
-**This is the workflow of this function**: A user needs to reset their
-forgotten password. The App must call the /user/:username/password/reset
-API where :username is the placeholder to substitute with the username.
-The server checks if the email address is present within the
-visibleByTheUser fields in the user profile. The server sends an email to
-that address with a generated link to follow to reset the password. The
-user opens the email and opens the given link in a web browser. A form is
-shown with two html password fields. The user fills in the two fields
-and submits the form. A confirmation message is shown by the server Many
-settings can be setup by the administrator via the Settings menu in the
-admin console, or via the Settings API **Some of them are**: The SMTP
-Server configuration. The email message to be sent The HTML Form to show
-in order to reset the password. The confirmation and the error web page
-
-**Returns**:
-
-- Code 500: the server cannot fulfill the request, an internal server
- error occurred
-- Code 400: the X-BAASBOX-APPCODE header is not valid or it is empty or
- the email address is not configured for the given user
-- Code 200: OK. The reset email was sent
-
-
-Test if a username already exists
----------------------------------
-
-**Not yet implemented**\ ``GET /user/:username/exists``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 401: Credentials supplied in the ‘authorization’ header are
- invalid or missing
-
-Logged users
-============
-
-Retrieve current user profile
------------------------------
-
-``GET /me``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks` for
-authentication hints.
-
-**Description**: Retrieves the information about
-the user. Specifically the following JSON is returned:
-
-::
-
- {
-
- "visibleByTheUser": {...},
-
- "visibleByFriend": {...},
-
- "visibleByRegisteredUsers": {...},
-
- "visibleByAnonymousUsers": {...}
-
- }
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 401: Credentials supplied in the ‘authorization’ header are
- invalid or missing
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 200: OK: retrieves he JSON object representing the current user
-
-Update current user
--------------
-
-``PUT /me``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Body payload**\ A JSON object like this:
-
-::
-
- {
-
- "visibleByTheUser": {...},
-
- "visibleByFriend": {...},
-
- "visibleByRegisteredUsers": {..},
-
- "visibleByAnonymousUsers": {...}
-
- }
-
-- **visibleByTheUser** is an object whose fields are private and
- visible only by the user
-- **visibleByFriend** is an object whose fields are visible by the user
- and their friends (for future friendship management)
-- **visibleByRegisteredUsers** is an object whose fields are visible by
- the user, their friends, any registered user
-- **visibleByAnonymousUsers** is an object whose fields are public and
- visible by everyone, even anonymous users
-
-**Description**: Update an user profile information.
-
-The four JSON objects are optional. Using this API you can send just one of them or all four.
-
-PAY ATTENTION: The previously stored content for each of the JSON objects will be overwritten with what was sent through this API.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 401: Credentials supplied in the ‘authorization’ header are
- invalid or missing
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 200: OK: retrieves the JSON object representing the current user
-
-Change password
----------------
-
-``PUT /me/password``
-
-**Headers**: See the :doc:`/RestAPI/general_remarks`
-
-**Body payload**\ A JSON object like this:
-
-::
-
- {
-
- "old": "the old password",
-
- "new": "the new password"
-
- }
-
-both old and new fields are mandatory.
-
-**Description**: Changes the password of a user.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 401: Credentials supplied in the ‘authorization’ header are
- invalid or missing
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 400: the old password is invalid
-- Code 200: OK
-
-Follow and Unfollow Users
-=========================
-
-Create a friendship relation
-----------------------------
-
-``POST /follow/:username``
-
-**Headers**: See authorization header in the :doc:`/RestAPI/general_remarks`
-
-**Description**: This API allows a user to create a friendship relationship with another user whose username is the one specified in the :username URL component. Once the friendship relation has been created, the follower will be able to see the documents created by the followed user as well as its visibleByFriends data in its user profile
-
-**Returns**:
-
-- Code 201: (CREATED) response code if the operation is successful
-- Code 404: (NOT FOUND) response if the username provided does not exists
-- Code 400: (BAD REQUEST) if the relationship between users already exists
-
-Delete a friendship relation
-----------------------------
-
-``DELETE /follow/:username``
-
-**Headers**: See authorization header in the :doc:`/RestAPI/general_remarks`
-
-**Description**: This API allows a user to delete a friendship relationship with another user whose username is the one specified in the :username URL component.Once the friendship relation has been deleted the follower will not be able to see the documents created by the followed user as well as its visibleByFriends data in its user profile.
-
-**Returns**:
-
-- Code 200: (OK) response code if the operation is successful
-- Code 404: (NOT FOUND) response if the username provided does not exists or if the relationship does not exists
-
-Get all following
------------------
-
-``GET /following``
-
-**Headers**: See authorization header in the :doc:`/RestAPI/general_remarks`
-
-**Description**: This API returns a list of users that are followed by the current one (the one that made the call).
-The method returns in its data property an array filled with the user profiles representing its "friends". Each profile will contain the ``visibleByFriends`` data which would be otherwise
-protected.
-
-
-**Returns**:
-
-- Code 200: (OK) response code if the operation is successfull
-Returns an empty collection instead of error 404 if elements not exist.
-
-Get following by username
--------------------------
-
-``GET /following/:username``
-
-**Headers**: See authorization header in the :doc:`/RestAPI/general_remarks`
-
-**Parameters**\
-
-- **username**: the username of the user who wants to get the following user
-
-**Description**: This API returns a list of users that are followed by the user passed in parameter. In its data property the method returns an array filled with the user profiles representing its friends. Each profile will contain the visibleByFriends data, which would be otherwise protected.
-
-**Returns**:
-
-- Code 200: (OK) response code if the operation is successful
-Returns an empty collection instead of error 404 if elements do not exist.
-
-Get all followers
------------------
-
-``GET /followers``
-
-**Headers**: See authorization header in the :doc:`/RestAPI/general_remarks`
-
-**Description**: This API returns the list of followers.
-The method returns in its data property an array filled with the user profiles representing its "friends". Each profile will contain the ``visibleByFriends`` data which would be otherwise
-protected.
-This API supports filter criteria, sorting, pagination
-
-**Returns**:
-
-- Code 200: (OK) response code if the operation is successful
-- Code 404: (NOT FOUND) response if the user does not have any friend relationships
-
-Get followers by username
--------------------------
-
-``GET /followers/:username``
-
-**Headers**: See authorization header in the :doc:`/RestAPI/general_remarks`
-
-**Parameters**\
-
-- **username**: the username of the user who wants to get the followers user.
-
-**Description**: This API returns the list of followers by the username passed in parameter. In its data property the method returns an array filled with the user profiles representing its friends. Each profile will contain the visibleByFriends data which would be otherwise protected.
-This API supports filter criteria, sorting, pagination
-
-**Returns**:
-
-- Code 200: (OK) response code if the operation is successful
-- Code 404: (NOT FOUND) response if the user does not have any friend relationships
-
-Click here for the :doc:`/RestAPI/Users/social_login` section
View
40 RestAPI/assets.rst
@@ -1,40 +0,0 @@
-Assets
-=======
-
-**IMPORTANT**: To create the Assets you must use the related :doc:`Admin/admin_assets`
-
-Retrieve
-----------
-
-``GET /asset/:name``
-
-If the asset is a file, this API retrieves the file. In
-the response header the server will indicate the file content-type.
-
-**Example**:
-
-``http://localhost:9000/asset/testimg``
-
-If the caller is a
-browser and the asset is an image, the browser will show the image
-itself.
-
-WARNING: the name to use in the GET request is the one that was
-set up in the name field when the asset was created, not its file name
-sent to the server.
-
-WARNING 2: If the asset is an object, an error 404
-is sent.
-
-``GET /asset/:name/data``
-
-Retrieves the related data of the asset, including
-the meta field supplied at the time of creation and, if the asset is a
-file, the file name, the file dimension, the content type.
-
-``GET /asset/:name/download``
-If the asset is a file, this API streams its
-content adding the header **Content-Disposition: attachment;
-filename=**\ This header forces the browser to download the file, even
-if its content type is known. Please note that the user agent could
-ignore this header.
View
433 RestAPI/documents.rst
@@ -1,433 +0,0 @@
-Documents
-=========
-
-Create a document
------------------
-
-``POST /document/:collection``
-
-**Headers**: See authorization header in the
-:doc:`general_remarks`
-
-**Description**: Create a new
-document into the specified collection. The collection must exist and
-must have been previously created by the admin.
-
-**Body payload**\ Any
-valid JSON string.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 404: the collection specified does not exist
-- Code 200: OK and unique ID will be returned.
-
-**NOTE on Record
-Security Level**\
-
-The owner can update and delete documents. Their friends (feature not
-fully implemented) can only see the documents. All other users but the
-admins cannot have any kind of access to the documents.
-
-Modify a document
------------------
-
-``PUT /document/:collection/ID``
-
-**Headers**: See authorization header in
-the :doc:`general_remarks`
-
-**Description**: Updates the
-document content. WARNING: the content is replaced, neither added nor
-merged. Only the owner of the document and the admin, or backoffice
-users, can modify it.
-
-**Body payload**\ Any valid JSON string.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 403: FORBIDDEN, the user does not have the necessary privilege
- to update the document
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 404: the collection specified does not exist
-- Code 200: OK and the internal JSON document representation.
-
-Retrieve a document
--------------------
-
-``GET /document/:collection/ID``
-
-**Headers**: See authorization header in
-the :doc:`general_remarks`
-
-**Description**: Retrieves the
-specified document Only the owner of the document and the admin or
-backoffice users can retrieve it.
-
-Anonymous users can retrieve documents
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 403: FORBIDDEN, the user does not have the necessary privilege
- to update the document
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 404: the collection specified does not exist
-- Code 200: OK and the internal JSON document representation.
-
-Delete a document
------------------
-
-``DELETE /document/:collection/ID``
-
-**Headers**: See authorization header in
-the :doc:`general_remarks`
-
-**Description**: Delete a
-document in the specified collection. Only the owner of the document and
-the admin or backoffice users can delete it.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 204: Document deleted
-- Code 404: Document not found, or collection not found or document
- doesn’t belong to the collection
-
-Count the number of documents in a collection
----------------------------------------------
-
-``GET /document/:collection/count``
-
-**Headers**: See authorization header in
-the :doc:`general_remarks`
-
-**Description**: Returns the
-number of documents that the USER COULD READ in a collection. Pay
-attention because there could be documents that the user cannot read,
-and therefore are not included
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 404: the collection does not exist
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 200: OK, and a JSON list of documents
-
-Retrieves a list of Documents
------------------------------
-
-``GET /document/:collection``
-
-**Headers**: See authorization header in the
-:doc:`general_remarks`
-
-**Description**: Returns the
-documents that the USER CAN READ in a collection. Pay attention because
-there could be documents that the user cannot read, and therefore will
-not be retrieved
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 404: the collection does not exist
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 200: OK, and a JSON list of documents
-
-Grant/revoke user/role
-----------------------
-
-``PUT /document/:collection/:id/:action/user/:username``
-
-or
-
-``PUT /document/:collection/:id/:action/role/:rolename``
-
-**Headers**: See authorization header in the :doc:`general_remarks`
-
-**Description**: Returns the documents that the USER CAN READ in a collection.
-**where:**
-
- * collection is the name of the collection
- * id is the unique id of the document belonging to the :collection
- * action is the kind of grant you want to give:"read", "update", "delete", "all"
- * username is the user to give the grant
- * rolename is the name of a role. In this case every user belonging to that role will have the specified grant.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 404: the collection does not exist
-- Code 500: the servers cannot fulfill the request, an internal server error occurred
-- Code 200: OK
-
-**To revoke a permission just use DELETE instead of PUT**
-
-Update objects fields
----------------------
-
-Available since version 0.7.2
-
-Starting from version 0.7.2 it is possible to update single fields of an
-object in a collection without sending the whole object JSON
-representation to the server .
-
-A new endpoint was added to the BaasBox Document API
-
-``PUT /document/:collection/:id/(.:fieldName)+``
-
-**Headers**: See authorization header in the :doc:`general_remarks`
-
-**Description**: Modify a single field specified by the fieldname
-parameter: the fieldName must start with a . (dot). It could be a simple property
-or a complex JSON object or even an array using the notation
-.array[index] where the index is a valid integer.
-
-**Body payload**: A JSON object with a "data" field (see examples below)
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 403: FORBIDDEN, the user does not have the necessary privilege
- to update the document
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 404: the specified collection does not exist
-- Code 200: OK and the internal JSON document representation
-
-
-Some examples of the new API
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-We will use the simple object below to explain the new feature modifying
-its fields:
-
-::
-
- {"title":"a simple post","content":"the content of this awesome post"}
-
-Saving the object to a **posts** collection will return the object with
-the following ID **a1b45ea7-7005-4f24-ae5e-76a6840ab856**
-
-Let's say we want to modify the title
-
-Making a **PUT** request to the following URL
-/document/posts/a1b45ea7-7005-4f24-ae5e-76a6840ab856/.title and with the
-following request body
-
-::
-
- {"data":"this is the new title"}
-
-Will return the following JSON
-
-::
-
- {
- "result": "ok",
- "data": {
- "@ID": "#24:0",
- "@version": 3,
- "@class": "posts",
- "title": "this is the new title",
- "content": "the content of this awesome post",
- "id": "a1b45ea7-7005-4f24-ae5e-76a6840ab856"
- },
- "http_code": 200
- }
-
-As you can see we are using a dot before the field name in the URL of
-the request.
-
-A post without tags is not a real post so let's add it as an array of
-strings:
-
-Making a **PUT** request to the following URL
-/document/posts/a1b45ea7-7005-4f24-ae5e-76a6840ab856/.tags and with the
-following request body
-
-::
-
- {"data":["awesomeness","tag1","tag2"]}
-
-Will return the following JSON:
-
-::
-
- {
- "result": "ok",
- "data": {
- "@ID": "#24:0",
- "@version": 4,
- "@class": "posts",
- "title": "this is the new title",
- "content": "the content of this awesome post",
- "id": "a1b45ea7-7005-4f24-ae5e-76a6840ab856",
- "tags": [
- "awesomeness",
- "tag1",
- "tag2"
- ]
- },
- "http_code": 200
- }
-
-As you can see a tags field was added to the object.
-
-Now let's say that we want to add an element to this tags array:
-
-Making a **PUT** request to the following URL
-/document/posts/a1b45ea7-7005-4f24-ae5e-76a6840ab856/.tags[3] with the
-following request body
-
-::
-
- {"data":"new tag"}
-
-Will return:
-
-::
-
- {
- "result": "ok",
- "data": {
- "@ID": "#24:0",
- "@version": 5,
- "@class": "posts",
- "title": "this is the new title",
- "content": "the content of this awesome post",
- "id": "a1b45ea7-7005-4f24-ae5e-76a6840ab856",
- "tags": [
- "awesomeness",
- "tag1",
- "tag2",
- "new tag"
- ]
- },
- "http_code": 200
- }
-
-And what if we want to modify a tag at a specific index?
-
-Making a **PUT** request to the following URL
-/document/posts/a1b45ea7-7005-4f24-ae5e-76a6840ab856/.tags[3] with the
-following request body
-
-::
-
- {"data":"new tag modified"}
-
-Will return
-
-::
-
- {
- "result": "ok",
- "data": {
- "@ID": "#24:0",
- "@version": 6,
- "@class": "posts",
- "title": "this is the new title",
- "content": "the content of this awesome post",
- "id": "a1b45ea7-7005-4f24-ae5e-76a6840ab856",
- "tags": [
- "awesomeness",
- "tag1",
- "tag2",
- "new tag modified"
- ]
- },
- "http_code": 200
-
-}
-
-And what about nested objects:
-
-Making a **PUT** request to the following URL
-/document/posts/a1b45ea7-7005-4f24-ae5e-76a6840ab856/.author with the
-following request body
-
-::
-
- {"data":{"name":"admin","roles":["admin","superawesome","superuser"]}}
-
-Will return
-
-::
-
- {
- "result": "ok",
- "data": {
- "@ID": "#24:0",
- "@version": 9,
- "@class": "posts",
- "title": "this is the new title",
- "content": "the content of this awesome post",
- "id": "a1b45ea7-7005-4f24-ae5e-76a6840ab856",
- "tags": [
- "awesomeness",
- "tag1",
- "tag2",
- "new tag modified"
- ],
- "author": {
- "roles": [
- "admin",
- "superawesome",
- "superuser"
- ],
- "name": "admin"
- }
- },
- "http_code": 200
- }
-
-The **author** object was added and we can also modify its inner
-properties
-
-Making a **PUT** request to the following URL
-/document/posts/a1b45ea7-7005-4f24-ae5e-76a6840ab856/.author/.roles[3]
-with the following request body
-
-{"data":"optimus prime"}
-
-Will return:
-
-::
-
- {
- "result": "ok",
- "data": {
- "@ID": "#24:0",
- "@version": 10,
- "@class": "posts",
- "title": "this is the new title",
- "content": "the content of this awesome post",
- "id": "a1b45ea7-7005-4f24-ae5e-76a6840ab856",
- "tags": [
- "awesomeness",
- "tag1",
- "tag2",
- "new tag modified"
- ],
- "author": {
- "roles": [
- "admin",
- "superawesome",
- "superuser",
- "optimus prime"
- ],
- "name": "admin"
- }
- },
- "http_code": 200
- }
View
233 RestAPI/file.rst
@@ -1,233 +0,0 @@
-Files
-=====
-
-Available since version 0.7.3
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-BaasBox has been able to store and manage files since its 0.7.3 version.
-Every registered user can store files of any kind and associate an
-arbitrary JSON object to them, as Assets already can. Unlike them,
-however, only the user who created them, administrators and users who
-have the role of "BackOffice" can access such files, as well as the
-documents. Moreover, it is possible to enter queries through selection
-and ordering criteria on the JSON data associated to the files.
-
-The maximum size of a file is 2GB, but we do not recommend reaching such
-size, since BaasBox is a software that provides backend services for
-mobile Apps. Currently we do not support resume functions for upload and
-download.
-
-Create a file
--------------
-
-``POST /file``
-
-**Headers**: See :doc:`general_remarks`
-and:
-
- - content-type: multipart/form-data
-
-**Description**: This API stores a new file into the BaasBox embedded DB.
-
-**Body payload** The body can contain the following fields:.
-
-- file: **MANDATORY**. The file itself
-- attachedData: optional. A string representing a valid JSON string.
- Here you can store any data associated to the file.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 400: the "file" field is not present in the received request
-- Code 401: unauthorized user
-- Code 201: file created
-- Code 200: OK and unique ID will be returned
-
-If BaasBox stores a file, it will return a JSON string with all the data
-representing the file itself, including the unique identifier (ID) to
-retrieve it later.
-
-Delete a file
--------------
-
-``DELETE /file/:id``
-
-**Headers**:
-
-- See :doc:`general_remarks`
-- User must have the right to delete the file
-
-**Description**: This API deletes a given file
-
-**Parameters**
-
-- id: the unique identifier of the file
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 401: user unauthorized
-- Code 404: file not found
-- Code 200: OK. The file has been deleted
-
-Stream a file
--------------
-
-``GET /file/:id``
-
-**Headers**:
-
-- See :doc:`general_remarks`
-
-- User must have the right to read the file
-
-**Description**: Stream the content of the file to the client
-
-**Parameters**:
-
-- id: the unique identifier of the file
-
-**QueryString**:
-
-- download: when true the **"Content-Disposition"** header with the **attachment; filename="<filename>"** value is sent. This allows the browsers to download the file instead of trying to manage it themselves (as it happens with images for example)
-- resize: same as assets (whose explanation you can look at) it tells the server that the image you want to retrieve has to be resized. Allowed values are those defined in the image settings.
-- sizeId: same as assets. Instead of specifying a value for resizing, it refers to the list of allowed formats. This value is a zero-based array index relating to the list of those values allowed in the image settings.
-
-**Image settings**
-The value list for allowed formats is not comma-separated, as wrongly stated so far, but it is space-separated.
-A new format was added:
-<=nnpx
-where nn is the number of pixels.
-With this format we want the size of the returned image to be no more than nn pixels both in height and in width. Basically, should one of the two exceed the value of nn, it automatically gets resized to nn and the other parameter scales, keeping the same aspect ratio.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 401: user unauthorized
-- Code 404: file not found
-- Code 200: OK. The file content is returned
-
-Retrieve a file details
------------------------
-
-``GET /file/details/:id``
-
-**Headers**:
-
-- See :doc:`general_remarks`
-- User must have the right to read the file
-
-**Description**: Returns relevant data about a stored file:
-
-- the original file name
-- its content type
-- its content length
-- its attached data
-- the user that stored the ID
-- the storage data
-
-**Parameters**
-
-- id: the unique identifier of the file
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 401: user unauthorized
-- Code 404: file not found
-- Code 204: Document deleted
-
-Retrieve only the attached data for a given file:
--------------------------------------------------
-
-``GET /file/attachedData/:id``
-
-**Headers**:
-
-- See :doc:`general_remarks`
-- User must have the right to read the file
-
-**Description**: Returns the attached data related to a given file. IE:
-returns the JSON object sent when the file has been created.
-
-**Parameters**:
-
-- id: the unique identifier of the file
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 401: user unauthorized
-- Code 200: OK. The data are returned
-
-Retrieves details of all the stored files
------------------------------------------
-
-``GET /file/details``
-
-**Headers**:
-
-- See :doc:`general_remarks`
-- User must have the right to read the files
-
-**Description**: Returns relevant data about all the stored files.
-Please note that only the files that can actually be read from the user
-are returned.
-
-For each file the following data are returned:
- - the original file name
- - its content type
- - its content length
- - its attached data
- - the user that stored id
- - the storage date
-
-NOTE: this API supports QueryStrings selection and sort criteria. Please
-refer to the Query Criteria section in the :doc:`general_remarks` page.
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 401: user unauthorized
-- Code 404: file not found
-- Code 200: OK. The data are returned
-
-Grant/revoke user/role
-----------------------
-
-``PUT /file/:id/:action/user/:username`` or ``PUT
-/file/:id/:action/role/:rolename``
-
-**Headers**: See authorization header in the :doc:`general_remarks`
-
-**Description**: Grant a user (o an entire role) specific permission on
-a file.
-
-**Parameters:**
-
-- :id is the unique id of the file
-- :action is the kind of grant you want to give: "read", "update",
- "delete", "all"
-- :username is the user to give the grant
-- :rolename is the name of a role. in this case every user belonging to
- that role will have the specified grant
-
-**Returns**:
-
-- Code 400: the X-BAASBOX-APPCODE contains an invalid application code
-- Code 404: the id does not exist
-- Code 500: the servers cannot fulfill the request, an internal server
- error occurred
-- Code 200: OK
-
-**To revoke a permission just use DELETE instead of PUT**
View
123 RestAPI/general_remarks.rst
@@ -1,123 +0,0 @@
-.. _rest-API:
-
-General Remarks
-===============
-
-These are the general notes about the REST API protocol used by BaasBox
-and its JSON format.
-
-Request Headers
---------------
-
-If not specified otherwise, all requests need some custom HTTP headers.
-
-These are BaasBox **Authentications headers**\, since the 0.5.7 version
-supports two authentication methods: HTTP Basic Authentication, or via a
-Session Token.
-
-Basic Authentication
---------------------
-
-It needs to provide the user’s credentials via the basic access authentication method. Username and
-password must be combined into a string “username:password” and then
-encoded using BASE64. The header must be in the form: ``Authorization:
-Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==`` . If the authentication fails, the
-server replies with BAD REQUEST http error (code 400)
-**X-BAASBOX-APPCODE**\: This is the application code, by default this
-is: ``1234567890``
-
-Session Token
--------------
-
-To use this authentication method, the client has to call
-the ``/users/login`` API. The Server will provide a token to use in the
-subsequent calls. All tokens will be invalidated if the server is stopped. To pass the session
-token to the server, use the following header:
-
-``X-BB-SESSION: 0000-1111-2222-3333``
-
-The JSON response
------------------
-
-Every response generated by BaasBox as a result of a REST call is a JSON
-object with the following structure:
-
-::
-
- {
-
- "result": "ok|ko",
-
- "http_code": (200|201|204),
-
- "data": {
-
- ...the data themselves...
-
- }
-
- }
-
-In case of error, the data returned are more detailed and are useful to
-understand why the request was rejected. In this case, the JSON format
-is:
-
-
-::
-
- {
-
- "result": "error",
-
- "bb_code": xxx,
-
- "message": "...a message explaining the problem in plain English...",
-
- "resource": "...the REST API called....",
-
- "method": "...the HTTP method used...",
-
- "request_header": { .... the headers received by the server ...},
-
- "API_version": "...the BaasBox API version..."
-
- }
-
-For bb\_code see below.
-
-Custom Error Codes
-------------------
-
-These are custom error codes specific to BaasBox
-
-- 40001: You are attempting to update a database object with older
- data. Version is not the same
-- 40101: Invalid or not provided authentication info. HINT: Has your
- session expired?
-- 50301: Push settings are not properly configured. HINT: go to
- administration console and check the settings
-- 50302: The server cannot resolve the host name. HINT: check your
- internet connection
-- 50303: Could not send push notifications. HINT: Check your API Key(Google)
-
-
-Query Criteria
---------------
-
-Some APIs allow to specify query criteria. Accepted parameters are:
-
-- **where**: set a filter criteria in a SQL-like fashion (i.e.: ``“color=’yellow’ or address.city=’rome’”``). It is possible to use the positional mode, for example: ``“color=? or address.city=?”``. In this case you must supply the parameters’ values using the ``params`` querystring parameter. NOTE:the value of the parameter must be URL encoded.
-- **params**: an array of value for the where clause. For example:
- ``/API\_URL/WHERECLAUSE/&params=yellow&params=cyan``
-- **orderBy**: set an order by clause in a SQL-like fashion (i.e.:
- orderBy name desc). NOTE: the direction of ordering (asc or desc) is
- mandatory if pagination is used (see below)
-- **page**: a 0 based index indicating the page requested
-- **recordPerPage**: the number of records per page
-- **fields**: allow to specify a subset of fields (projections) to return instead of the entire record. It is also possibile to specify aggregate functions and execute all the operations allowed by OrientDB into the "select" statements. An exaustive list of available functions is available at https://github.com/orientechnologies/orientdb/wiki/SQL-Where#wiki-field-operators, meanwhile the explanation of how to specify projections is at https://github.com/orientechnologies/orientdb/wiki/SQL-Query#projections
-- **groupBy**: allow to indicate a "group by" criteria to group the result-set by one or more fields just like in standard SQL statements. This criteria is used in conjunction with the aggregate functions expressed into the "fields"
-
-**Example of valid calls**:
-``/document/mycoolestcollection/count?where=color%3D’yellow’``
-``/document/mycoolestcollection/count?where=color%3D%3F&params%3dyellow``
-``/document/documents/count?where=color%3D%3F%20or%20color%3D%3F&params=yellow&params=cyan``