This project is read-only.

Usage

To use this API please read the documentation for the Camelot JSON Command Object and the examples section.

Installation

Download WSP Package from the downloads section.

Install the Prerequisites

Download and install the Camelot .NET Connector
http://www.bendsoft.com/redirect/camelot-net-connector/

Install with STSADM

Navigate to the folder where you store the wsp-package and enter the following commands

stsadm -o addsolution -filename "Camelot.JSONAPI.wsp"
stsadm -o deploysolution -name "Camelot.JSONAPI.wsp" -immediate -allowGacDeployment
stsadm -o execadmsvcjobs

Installation with PowerShell

Navigate to the folder where you store the wsp-package and enter the following commands

Add-PSSnapin Microsoft.SharePoint.PowerShell
 
$solutionName = "Camelot.JSONAPI.wsp"
$solutionPath = Join-Path $(get-location) -childpath $solutionName
$solution = Add-SPSolution $solutionPath
 
$service = Get-Service -Name SPAdminV4
if($service.Status -eq "Running") {
	Install-SPSolution -Identity $solution.Name -GACDeployment
	net stop SPAdminV4
	Start-SPAdminJob
	net start SPAdminV4
} else {
	net start SPAdminV4
	Install-SPSolution -Identity $solution.Name -GACDeployment
	net stop SPAdminV4
	Start-SPAdminJob
}

Configure Claims (important!)

To allow impersonation of the user accessing the JSON API we must ensure the account running the service is allowed to perform the impersonation. This is done by adding some callers to a config file owned by the Windows Identity Foundation service known as Claims to Windows Token Service.

Add the user(s) that may need privileges to perform this action

<allowedCallers>
  <clear />
  <add value="WSS_WPG" />
  <!--if aspnet:AllowAnonymousImpersonation = true-->
  <add value="NT AUTHORITY\IUSR" />
  <!--if aspnet:AllowAnonymousImpersonation = false-->
  <!--<add value="NT AUTHORITY\Network Service" />-->
</allowedCallers>

Ensure the service is started and if it is restart it 

Modify your web.config (optional)

Create a backup of your web.config before editing the file!

Locate the web.config of your SharePoint Web, if you plan to use this on several webs this must be implemented on each web. The default web are usually placed in this folder, C:\inetpub\wwwroot\wss\VirtualDirectories\80\. Open the file in the text editor of your choice.

Add a connectionstring (optional)

Note! You will only need to perform this step if you plan to implement custom connection strings. The default setting is to connect using the current users credentials using impersonation.

Insert a connection string in the <configuration> section. The name of the connection string is the reference to the connection parameter in the Camelot JSON Command Object.

<connectionStrings>
  <add name="Default" connectionString="server=serverurl;database=/;user=accountname;domain=;password=yourpassword;DefaultLimit=10000;TimeOut=120"/>
</connectionStrings>

To add several connection strings simply create several elements

<connectionStrings>
  <add name="Default" connectionString="server=serverurl;database=/;user=accountname;domain=;password=yourpassword;DefaultLimit=10000;TimeOut=120"/>
  <add name="Web1" connectionString="server=web1;database=/;user=accountname;domain=;password=yourpassword;DefaultLimit=10000;TimeOut=120"/>
  <add name="Web1_Sales" connectionString="server=web1;database=/sales/;user=accountname;domain=;password=yourpassword;DefaultLimit=10000;TimeOut=120"/>
  <add name="OtherConnectionString" connectionString="server=otherserver;database=/;user=accountname;domain=;password=yourpassword;DefaultLimit=10000;TimeOut=120"/>
</connectionStrings>

Official connection string documentation: http://www.bendsoft.com/documentation/camelot-net-connector/latest/reference/connection-string-options/

Test the installation

Navigate the the url http://server/_vti_bin/Camelot.JSONAPI/jsonapi.svc

A page looking something like this should appear

Try to enter the url http://server/_vti_bin/Camelot.JSONAPI/jsonapi.svc/GetUser

This is a simple GET method that will return the currently logged in user. Note! If you are using Internet Explorer you may need to download the result and open in a text editor since IE doesn't allow content with unknown typing to be displayed.

API Path

When installed, the JSON API can be found at http://server/_vti_bin/Camelot.JSONAPI/jsonapi.svc

Last edited Jan 23, 2013 at 10:53 PM by Bendsoft, version 4

Comments

No comments yet.