Hello
Can I create a web service that make administration operation like create new user, create site collection, programmatically on SharePoint 2013 Online.
In more detail :
i created an application that simulate some sharePoint action like create groups create site colection create library affect credential … using webparts (drang and dropd , js…) to make the task easy for user.
this application is used like dropBox by organization (they create an account , a site collection is created , they create library ….)
the solution was a farmSolution , now we need to deploy it on SP online , and because i can’t do this code using client object model or sandbox solution (due to the limitation) i was thinking that i can create a web service that will excute object model code and then i consum it by client object model web part on SP Online
so the question can i create this web service , because i think that the web service need to be on the same server as Sp , and im using Sp online?
Ok. Found the solution…
Above code works if you change two things:
defaultUserloginName should be defaultUserLoginName (damn you case sensitive JavaScript!)
The username should include the authentication type characters (“i:0#.f|membership|”)
Sorry to re-open an older thread, but I have the same problem.
Currently I’m using SPServices to make contact to the SharePoint online webservices.
This is my code:
<script type=”text/javascript”>
function CreateGroups()
{
$().SPServices({
operation: “AddGroup”,
groupName:”TestGroup”,
ownerIdentifier:”company.support@domainname.onmicrosoft.com”,
ownerType:”user”,
defaultUserloginName:”company.support@domainname.onmicrosoft.com”,
description:”Test description”,
async: false,
completefunc: function (xData, Status){
alert(Status);
}
});
}</script>
Obviously, this doesn’t work… 🙂
This is the error that I get from the webservice:
The parameter loginName cannot be empty or bigger than 251 characters
Anyone can point me in the right direction? I’m have no idea what I should change :/
Thanks!
One word: Azure.
Some “slightly” outdated books that also cover webservices are http://www.amazon.com/Professional-SharePoint-2010-Cloud-Based-Solutions/dp/1118076575/ref=sr_1_5?s=books&ie=UTF8&qid=1371634347&sr=1-5 and http://www.amazon.com/Developing-Microsoft-SharePoint-Applications-Windows/dp/0735656622/ref=sr_1_5?s=books&ie=UTF8&qid=1371634360&sr=1-5&keywords=steve+fox+sharepoint , Steve Fox has also got some blog posts floating around on that topic.
What you’d also have to do is to authenticate with Office 365, for that part I recommend Wictor Wilén’s blog post: http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx
And this is also useful – “Web Services in SharePoint Online” : http://msdn.microsoft.com/en-us/library/gg454740%28v=office.14%29.aspx
Just so we have them … here’s the instructions on how to do the User bits in Powershell :
1. Connect Windows PowerShell to the Service
onlinehelp.microsoft.com/…/2b09b6a8-ad7e-446f-b7f0-273856beed70
2. After connecting to your Office 365 service, run the following command to get the accountskuID:
Get-MsolAccountSku
3. Run this command to create a new user and assign the user license:
New-MsolUser -DisplayName “testuser” –UserPrincipalName testuser@yourdomain.com –UsageLocation “US” | Set-MsolUserLicense -AddLicenses “tenantname:ENTERPRISEPACK”
Note: Change the “tenantname:ENTERPRISEPACK” to be your “accountskuID” and change the “US” to be your country code. UsageLocation is the two letter standard country code, for example US, DE, BE, GB.
Copied from here : http://community.office365.com/en-us/forums/148/t/83120.aspx