REST API StartUpload method - "The method or operation is not implemented"
Hi,
I've been looking at using the following to upload large files to SharePoint Online/OneDrive for Business.
http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx#bk_FileStartUpload
According to the documentation "This method is currently available only on Office 365."
When I try to use the StartUpload Method I get the following exception returned
{"error":{"code":"-1, System.NotImplementedException","message":{"lang":"en-US","value":"The
method or operation is not implemented."}}}
What I want to do is be able to upload large files to SharePoint online using a console application and the REST API.
At the moment I can upload a 512mb using the below, the problem I get with this is I don't get a response from the API. I get a timeout exception after 2 hours only when get a response on this line WebResponse response = request.GetResponse()
http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx#bk_FileCollectionAdd
Any help or pointers would be much appreciated. I've posted on a number of forums and had no success. Thanks
Hi,
We can do as follows:
1. If you have a large list, please look at the links below:
http://blogs.technet.com/b/speschka/archive/2009/11/13/large-list-throttling-for-external-lists-in-sharepoint-2010.aspx
http://akanoongo.blogspot.com/2011/02/how-to-resolve-2000-items-resolution-in.html
2. Also please check the steps about create an external list.
http://msdn.microsoft.com/en-us/library/office/ee558778(v=office.14).aspx
3. Create a new Table in Database and create a new external list to check whether the issue still exists.
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support
Similar Messages
-
Hi
I get the following error in my crawl logs
"Error while crawling LOB contents. ( Error caused by exception: Microsoft.BusinessData.Infrastructure.BdcException The shim execution failed unexpectedly - The method or operation is not implemented..; SearchID "
Because of this i suspect, the search results are not including those aspx pages marked as "Hide physical urls from search".
This error is not available in the another environment where the aspx pages are coming in the results.
Thanks
JoeHi Joe,
Greetings!
Reset the index and re-crawl. That usually clears it
If you are using NTLM authentication, then make sure that you specified the PassThrough authentication for crawling
Probably you need to debug the BDC code that underlies the external content types.
http://social.technet.microsoft.com/Forums/sharepoint/en-US/41a86c43-151d-47cd-af73-967a4c940611/lotus-notes-connector-error-while-crawling-lob-contents?forum=sharepointsearch
Please remember to click 'Mark as Answer' on the answer if it helps you -
Which Java API could check the type of Operating System the JVM is running?
Does anyone know which Java API could check the type of Operating System the JVM is running?
thanks a lot!check out System class.
regards
shyamAnd specifically, the getProperty() method.
- K -
Hi All,
We are trying to access the Create Deployment method stated below
http://msdn.microsoft.com/en-us/library/windowsazure/ee460813
We have uploaded the Package in the blob and browsing the configuration file. We have checked trying to upload manually the package and config file in Azure portal and its working
fine.
Below is the code we have written for creating deployment where "AzureEcoystemCloudService" is our cloud service name where we want to deploy our package. I have also highlighted the XML creation
part.
byte[] bytes =
new byte[fupldConfig.PostedFile.ContentLength + 1];
fupldConfig.PostedFile.InputStream.Read(bytes, 0, bytes.Length);
string a = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
string base64ConfigurationFile = a.ToBase64();
X509Certificate2 certificate =
CertificateUtility.GetStoreCertificate(ConfigurationManager.AppSettings["thumbprint"].ToString());
HostedService.CreateNewDeployment(certificate,
ConfigurationManager.AppSettings["SubscriptionId"].ToString(),
"2012-03-01", "AzureEcoystemCloudService", Infosys.AzureEcosystem.Entities.Enums.DeploymentSlot.staging,
"AzureEcoystemDeployment",
"http://shubhendustorage.blob.core.windows.net/shubhendustorage/Infosys.AzureEcoystem.Web.cspkg",
"AzureEcoystemDeployment", base64ConfigurationFile,
true, false);
<summary>
/// </summary>
/// <param name="certificate"></param>
/// <param name="subscriptionId"></param>
/// <param name="version"></param>
/// <param name="serviceName"></param>
/// <param name="deploymentSlot"></param>
/// <param name="name"></param>
/// <param name="packageUrl"></param>
/// <param name="label"></param>
/// <param name="base64Configuration"></param>
/// <param name="startDeployment"></param>
/// <param name="treatWarningsAsError"></param>
public static
void CreateNewDeployment(X509Certificate2 certificate,
string subscriptionId,
string version, string serviceName, Infosys.AzureEcosystem.Entities.Enums.DeploymentSlot deploymentSlot,
string name, string packageUrl,
string label, string base64Configuration,
bool startDeployment, bool treatWarningsAsError)
Uri uri = new
Uri(String.Format(Constants.CreateDeploymentUrlTemplate, subscriptionId, serviceName, deploymentSlot.ToString()));
XNamespace wa = Constants.xmlNamespace;
XDocument requestBody =
new XDocument();
String base64ConfigurationFile = base64Configuration;
String base64Label = label.ToBase64();
XElement xName = new
XElement(wa + "Name", name);
XElement xPackageUrl =
new XElement(wa +
"PackageUrl", packageUrl);
XElement xLabel = new
XElement(wa + "Label", base64Label);
XElement xConfiguration =
new XElement(wa +
"Configuration", base64ConfigurationFile);
XElement xStartDeployment =
new XElement(wa +
"StartDeployment", startDeployment.ToString().ToLower());
XElement xTreatWarningsAsError =
new XElement(wa +
"TreatWarningsAsError", treatWarningsAsError.ToString().ToLower());
XElement createDeployment =
new XElement(wa +
"CreateDeployment");
createDeployment.Add(xName);
createDeployment.Add(xPackageUrl);
createDeployment.Add(xLabel);
createDeployment.Add(xConfiguration);
createDeployment.Add(xStartDeployment);
createDeployment.Add(xTreatWarningsAsError);
requestBody.Add(createDeployment);
requestBody.Declaration =
new XDeclaration("1.0",
"UTF-8", "no");
XDocument responseBody;
RestApiUtility.InvokeRequest(
uri, Infosys.AzureEcosystem.Entities.Enums.RequestMethod.POST.ToString(),
HttpStatusCode.Accepted, requestBody, certificate, version,
out responseBody);
<summary>
/// A helper function to invoke a Service Management REST API operation.
/// Throws an ApplicationException on unexpected status code results.
/// </summary>
/// <param name="uri">The URI of the operation to invoke using a web request.</param>
/// <param name="method">The method of the web request, GET, PUT, POST, or DELETE.</param>
/// <param name="expectedCode">The expected status code.</param>
/// <param name="requestBody">The XML body to send with the web request. Use null to send no request body.</param>
/// <param name="responseBody">The XML body returned by the request, if any.</param>
/// <returns>The requestId returned by the operation.</returns>
public static
string InvokeRequest(
Uri uri,
string method,
HttpStatusCode expectedCode,
XDocument requestBody,
X509Certificate2 certificate,
string version,
out XDocument responseBody)
responseBody =
null;
string requestId = String.Empty;
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
request.Method = method;
request.Headers.Add("x-ms-Version", version);
request.ClientCertificates.Add(certificate);
request.ContentType =
"application/xml";
if (requestBody != null)
using (Stream requestStream = request.GetRequestStream())
using (StreamWriter streamWriter =
new StreamWriter(
requestStream, System.Text.UTF8Encoding.UTF8))
requestBody.Save(streamWriter,
SaveOptions.DisableFormatting);
HttpWebResponse response;
HttpStatusCode statusCode =
HttpStatusCode.Unused;
try
response = (HttpWebResponse)request.GetResponse();
catch (WebException ex)
// GetResponse throws a WebException for 4XX and 5XX status codes
response = (HttpWebResponse)ex.Response;
try
statusCode = response.StatusCode;
if (response.ContentLength > 0)
using (XmlReader reader =
XmlReader.Create(response.GetResponseStream()))
responseBody =
XDocument.Load(reader);
if (response.Headers !=
null)
requestId = response.Headers["x-ms-request-id"];
finally
response.Close();
if (!statusCode.Equals(expectedCode))
throw new
ApplicationException(string.Format(
"Call to {0} returned an error:{1}Status Code: {2} ({3}):{1}{4}",
uri.ToString(),
Environment.NewLine,
(int)statusCode,
statusCode,
responseBody.ToString(SaveOptions.OmitDuplicateNamespaces)));
return requestId;
But every time we are getting the below error from the line
response = (HttpWebResponse)request.GetResponse();
<Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Code>BadRequest</Code>
<Message>The specified configuration settings for Settings are invalid. Verify that the service configuration file is a valid XML file, and that role instance counts are specified as positive integers.</Message>
</Error>
Any help is appreciated.
Thanks,
ShubhenduPlease find the request XML I have found it in debug mode
<CreateDeployment xmlns="http://schemas.microsoft.com/windowsazure">
<Name>742d0a5e-2a5d-4bd0-b4ac-dc9fa0d69610</Name>
<PackageUrl>http://shubhendustorage.blob.core.windows.net/shubhendustorage/WindowsAzure1.cspkg</PackageUrl>
<Label>QXp1cmVFY295c3RlbURlcGxveW1lbnQ=</Label>
<Configuration>77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0NCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KDQogIFRoaXMgZmlsZSB3YXMgZ2VuZXJhdGVkIGJ5IGEgdG9vbCBmcm9tIHRoZSBwcm9qZWN0IGZpbGU6IFNlcnZpY2VDb25maWd1cmF0aW9uLkNsb3VkLmNzY2ZnDQoNCiAgQ2hhbmdlcyB0byB0aGlzIGZpbGUgbWF5IGNhdXNlIGluY29ycmVjdCBiZWhhdmlvciBhbmQgd2lsbCBiZSBsb3N0IGlmIHRoZSBmaWxlIGlzIHJlZ2VuZXJhdGVkLg0KDQogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCi0tPg0KPFNlcnZpY2VDb25maWd1cmF0aW9uIHNlcnZpY2VOYW1lPSJXaW5kb3dzQXp1cmUxIiB4bWxucz0iaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS9TZXJ2aWNlSG9zdGluZy8yMDA4LzEwL1NlcnZpY2VDb25maWd1cmF0aW9uIiBvc0ZhbWlseT0iMSIgb3NWZXJzaW9uPSIqIiBzY2hlbWFWZXJzaW9uPSIyMDEyLTA1LjEuNyI+DQogIDxSb2xlIG5hbWU9IldlYlJvbGUxIj4NCiAgICA8SW5zdGFuY2VzIGNvdW50PSIyIiAvPg0KICAgIDxDb25maWd1cmF0aW9uU2V0dGluZ3M+DQogICAgICA8U2V0dGluZyBuYW1lPSJNaWNyb3NvZnQuV2luZG93c0F6dXJlLlBsdWdpbnMuRGlhZ25vc3RpY3MuQ29ubmVjdGlvblN0cmluZyIgdmFsdWU9IkRlZmF1bHRFbmRwb2ludHNQcm90b2NvbD1odHRwcztBY2NvdW50TmFtZT1zaHViaGVuZHVzdG9yYWdlO0FjY291bnRLZXk9WHIzZ3o2aUxFSkdMRHJBd1dTV3VIaUt3UklXbkFrYWo0MkFEcU5saGRKTTJwUnhnSzl4TWZEcTQ1ZHI3aDJXWUYvYUxObENnZ0FiZnhONWVBZ2lTWGc9PSIgLz4NCiAgICA8L0NvbmZpZ3VyYXRpb25TZXR0aW5ncz4NCiAgPC9Sb2xlPg0KPC9TZXJ2aWNlQ29uZmlndXJhdGlvbj4=</Configuration>
<StartDeployment>true</StartDeployment>
<TreatWarningsAsError>false</TreatWarningsAsError>
</CreateDeployment>
Shubhendu G -
APIM REST API - How to add an API with operations?
When I issue a PUT to /apis/{aid} with import=true and contentType = application/json, I get an 400 BadRequest if the body contains operations. Note that I'm
not using WADL or Swagger format, and am building the JSON request body instead as per the documentation.
The error returned in the response body is:
{"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"operations","message":"Invalid
field 'operations' specified"}]}}
If I omit the operations field from the request body, the API is created correctly (but with no operations of course).
To illustrate, here is the RAW request (slightly modified to remove the authorization and instance names):
PUT https://testinstance.management.azure-api.net/apis/123456?api-version=2014-02-14-preview&import=true HTTP/1.1
Authorization: SharedAccessSignature . . .
Content-Type: application/json; charset=utf-8
Host: testinstance.management.azure-api.net
Content-Length: 414
Expect: 100-continue
Connection: Keep-Alive
{"name":"Customer","description":"This API is used to manage customers","serviceUrl":"http://www.somewebsite.com/customers","path":"customers","protocols":["http","https"],"operations":[{"id":"/apis/123456/operations/a04b16da-29b7-44f5-95a3-25603dbc9b6d","name":"Customer
(Get)","description":"Returns information about the customer with the specified ID.","method":"GET","urlTemplate":"/customers/{customerId}"}]}
The JSON looks correct to me - can anyone spot what I'm doing wrong? Can you provide a RAW request that works?
Note also that I've not included the "path" query string parameter, even though the documentation suggests that it is required when import=true. Since there is no easy way to update APIs/Operations en masse, I'm having to resort to driving
the APIM REST API and could use some additional documentation for this specific operation.Just updating this thread with the answer...my request body was malformed - I was using an array of objects for the operations field instead of a complex object representing the collection.
So instead of this:
"operations": [
...I should have been using this:
"operations": {
"value": [
You can see the correctly formatted payload in the sample response body returned from the
GetApi endpoint.
Thanks to Vlad for pointing out my mistake! -
Hi everyone,
Does anyone know how to use JSOM / REST APIs to retrieve the users that are following a specific document in SharePoint 2013?
Thanks in advance,
NamHi Nam,
Please use the sample code to get the followers for the document. Courtesy: Mokhtar
Bepari
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Social;
ClientContext clientContext = new ClientContext("http://URL");
SocialFollowingManager followingManager = new SocialFollowingManager(clientContext);
SocialActorInfo actorInfo = new SocialActorInfo();
actorInfo.ContentUri = "<documenturl>"; //set the document url.
actorInfo.ActorType = SocialActorType.Document;
//By using the GetFollowed method you can get the people who the current user is following.
ClientResult < SocialActor[] > followedResult = followingManager.GetFollowed(SocialActorTypes.Users);
//By using the GetFollowers() method you can get the people who are following the current user.
ClientResult < SocialActor[] > followersResult = followingManager.GetFollowers();
clientContext.ExecuteQuery();
Once you get the resultset you can iterate like below:
foreach(SocialActor actor in followedResult)
string name = actor.Name;
string imageURL = actor.ImageUri;
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply. -
Two questions about the methods in InputStream class.
1, close() method
the API says when the method is invoked, the input stream and its associateive channels are closed to release system resources.
What does it mean by "associative channels"?
2, read(byte[] b) method
the API says it reads b bytes of data and returns b.length as an Integer, however, I dont think what can this method do, because unlike normal read(), which returns the actual byte of data read, but returns the no of byte read, which I cant find a way to mainpulate with the data read.
Any help??
please help
thankswhile(true){
int lim = in.read(bufferArray);
if(lim == -1)break;
buffer.limit(lim);
buffer.flip();
channel.write(buffer);
buffer.clear();
while (true)
int lim = in.read(buffer);//No such method in InputStream
if (lim < 0) break;
buffer.flip();
channel.write(buffer);
buffer.compact();
My guess is that you didn�t read my original post properly. The variable in is an InputStream and it doesn�t have a read method that takes a ByteBuffer as an argument.
In my code I am using a byte array, which is backed by the buffer, I don�t believe that when writing to this byte array , the InputStream will try to update the internal accounting system of the buffer, that�s why I have done this manually by setting the limit of the buffer (the number of bytes actually read are set as the limit).
Correct me if I am a wrong thanks for your feedback . -
What is the best way to get storage data for hard disk using REST api
Hello All,
Given that I have disk info for virtual machine/role from service management REST api (for example using
GetRole) how I could retrieve container/blob related info for it?
So I have credentials for service management REST API, I have OSVirtualHardDisk info, but I am not sure how to detect correctly to which storage account connect and than which container to use. Yes, I know that there is OSVirtualHardDisk .MediaLink property
which contains storage account name and container inside of it but I am not sure it is good practice to assume about it format. Alternatively I have another solution - just retrieve all storage accounts from Service management REST, then compare url
of each account with disk's MediaLink. And use appropriate storage account for further data retrieve. But seem to me it could retrieve too many info.
So generally I am trying to find correct way to join service management REST api and Storage Services REST API for disksHi,
From my experience, your first approach is correct. The media link exactly points to the location of the blob. With the link, you can access the blob if you have the storage account key. If you want to extract more information, such as what
the container is and what the blob is, you can parse the link.
>> From my point of view it is bad way to retrieve storage account name and container.
In addition, you are welcome to post feature requests on
http://feedback.windowsazure.com/forums/34192--general-feedback
Best Regards,
Ming Xu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Office 365 Files REST API - Get direct children in the root of the default document library
I'm trying to work with Office 365 Files REST API which works just fine except one thing that I'm struggling with.
What I need for my application is to make an explorer like browse capability for OneDrive for business Document Library.
My problem is that I don't know how to get the direct children in the root of the Document library
The API request
GET ../_api/files will
retrieve all files and folders in the default document library, including files and folders from sub-directories.
What I need is basically the functionality of the API request
GET ../_api/files(<folder_path>)/Children
that works also for the root folder of the Document library. The problem is that I couldn't find a way set <folder_path> as the root folder.
I found out that the API call ../_api/web/getfolderbyserverrelativeurl(<folder_server_relative_path>)/Folders and _api/web/getfolderbyserverrelativeurl(<folder_server_relative_path>)/Files works as expected resulting the only the direct
children of the root folder if the folder_server_relative_path is the path of the document library. The problem with this API call is that it's requires server relative path of the (default) document library (which i don't have) and the result has a different
schema compared to the ../_api/files REST API call.
Can somebody help me with this problem?
DavidFirst thanks for the fast answer. Let me explain my use case in more details.
I'm trying to work with the new summer release of the
Office 365 API tool for Visual Studio 2013 (update 3)
I found no reasonable way to retrieve the direct children of the root folder from my One Drive for business Document Library using the newly added SharePointClient library.
The API call of `SharePointClient.Files` will retrieve all the files and folders from the whole document library including sub-folders. So in order to get only the direct children I have to page through all the documents and folders and analyze their URL, which
is not acceptable for my application scenario. For a sub-folder I can get the direct children like this: `SharePointClient.Files["<folder_id>"].ToFolder().Children` This is what I need but it can't be applied to the root folder.
So what I did I've checked what REST API calls this library makes and I've tried to find out if there is a way to achieve my goal at least using direct REST API call. It seems like the functionality is missing from the REST API itself.
The http://site
url/_api/web/lists/GetByTitle(‘libraryname’)/items API call also retrieves all the items hierarchy from the library (including items from sub-folders) and the result XML "schema" (fields and the meaning of the ID) differs from the one used
by the calls by SharePointClient library. (for example the "Id" is a number when the /items is called but when
/_api/files is called the "Id" is the relative path to the document library)
Basically what I need can be achieved with the call to http://site url/_api/web/lists/GetByTitle(‘libraryname’)/rootfolder/files and http://site
url/_api/web/lists/GetByTitle(‘libraryname’)/rootfolder/folders but again the schema of the result differs from the one used in SharePointClient
library. This means that in order to get the direct children of the root I will need to re-implement a good part of the SharePointClient library. It seams like there is 2 kind of REST API is implemented. ( missing "Id" and "url"
fields, etc)
Also there is no convenient way to get the Name or the GUID of the default document library which the SharePointClient.Files
(https://site_url/_api/file) automatically
uses. The DiscoveryContext.DiscoverCapability for "MyFiles" doesn't gives any hint either.
David -
The method ImportPicture fails in a deployment server
Hello
This is my code to import a picture
Public Shared Sub InsertarLogoCabecera(ByRef objReportDocument As ReportDocument, ByVal sPathLogo As String)
Dim objReportClientDocument As CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument
Dim objSection As CrystalDecisions.ReportAppServer.ReportDefModel.Section
Dim objImage As CrystalDecisions.ReportAppServer.ReportDefModel.PictureObject
Try
objReportClientDocument = objReportDocument.ReportClientDocument
objSection = objReportClientDocument.ReportDefController.ReportDefinition.PageHeaderArea.Sections(0)
objImage = objReportClientDocument.ReportDefController.ReportObjectController.ImportPicture(sPathLogo, objSection, 50, 50)
Catch ex As Exception
Utils.ErrorLog.RegistraError(ex, Utils.ErrorLog.ErrorGenerico.Interfaz, Nothing, 20000)
End Try
End Sub
End Class
In my computer everything is working ok but when the solution is published in other computer the next exception happens:
Mensaje:
Not implemented.
Error en archivo temp_d36c7f36-3688-4cee-9bfe-c143d768bff6 {DB92430B-0275-4805-8F50-FB29849B7C26}.rpt:
The operation is not yet implemented
Stack trace:
en CrystalDecisions.ReportAppServer.Controllers.ReportObjectControllerClass.ImportPicture(String filePath, Section Section, Int32 left, Int32 top)
en MyApplication.Web.Utils.Informes.InsertarLogoCabecera(ReportDocument& objReportDocument, String sPathLogo) en
source:
rptcontrollers.dllThere is no way to attach files. Typically sharing of files is reserved to phone cases only. See the Blog [What are these "support" forums good for anyhow?|/people/ludek.uher/blog/2011/04/07/what-are-these-support-forums-good-for-anyhow].
Does the other file work in the CR designer?
BTW.; phone cases can be created here:
http://store.businessobjects.com/store/bobjamer/en_US/pd/productID.98078100?resid=S6I@hgoHAkEAAGsiyVkAAAAR&rests=1282226845369
- Ludek -
FILES REST API url to list specific folder content
I need to retrieve the items/documents in a specific folder of our Office 365 hosted SharePoint site, but I always get an resource error. I'm trying to use the FILE REST API for this, documented here:
https://msdn.microsoft.com/office/office365/APi/files-rest-operations
The url to the SharePoint site with the files is
https://informationresourcemanager.sharepoint.com/irm/fido/1074/Forms/AllItems.aspx
and according to the MSDN documents the call should be
GET {base-url}/Files/{folder-id}/children
and "base-url" should in the case of SharePoint be
https://{tenant}.sharepoint.com/{site-path}/_api/v1.0
Now, I've tried 10 different combinations without getting any good results, so I guess I'm doing something wrong with the base-url or the site-path. Is the correct base-url this for my site
https://informationresourcemanager.sharepoint.com/irm/fido/_api/v1.0/
or just
https://informationresourcemanager.sharepoint.com/irm/_api/v1.0/
/JohanHi,
According to your description, my understanding is that you want to get all the content in a specific folder using Office 365 rest api.
For the base url, it needs to specify the site collection name in the url. In my environment, I have a site collection called "ZhengyuGuo", so we can get all the file in such site collection like below firstly:
https://xxx.sharepoint.com/sites/zhengyuGuo/_api/v1.0/files/
Then you can get the content in a specific folder using the "getByPath" method like below, in my environment, I will get the all file contents in document library folder.
https://xxx.sharepoint.com/sites/zhengyuGuo/_api/v1.0/files/getByPath('/')/children
The json data return like the capture below:
Thanks
Best Regards,
Jerry Guo
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Is there a way to get events using REST API when ever a file is downloaded.
Hi,
Seems that there is no such method in REST API can monitor the download event of file at this moment:
http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx
I would suggest you send a feedback to Office Developer Platform if there any expectation about SharePoint APIs or capabilities:
Customer Feedback for the Office Developer Platform
http://officespdev.uservoice.com/
Best regards,
Patrick
Patrick Liang
TechNet Community Support -
Set group owner using REST API
I'm trying to use the REST API to set the owner of a SharePoint group. I can successfully create the group using REST, but I can't change the owner. I've tried the following.
1 - Specifying a group owner while creating the group
Endpoint: .../_api/web/sitegroups
Method: POST
Headers:
Content-Type: application/json; odata=verbose
Body:
{ '__metadata': { 'type': 'SP.Group' }, 'Title': '<title>', 'Description': '<description>', 'Owner': { '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}}
This returns a 500 error: "The specified name is already in use. Please try again with a new name". In other words, the owner title I specified already exists, which is correct - I'm trying to make an existing principal the owner of the new group.
2 - Merging a new group owner into an existing group
Endpoint: .../_api/web/sitegroups(<group_id>)
Method: POST
Headers:
Content-Type: application/json; odata=verbose
X-HTTP-Method: MERGE
Body:
{ '__metadata': { 'type': 'SP.Group' }, 'Owner': { '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}}
This returns a 500 error with a Microsoft.SharePoint.SPException: "Exception from HRESULT: 0x80131904". The trace logs don't shed any light on it.
3 - Using the owner endpoint directly
Endpoint: .../_api/web/sitegroups(<group_id>)/owner
Method: POST
Headers:
Content-Type: application/json; odata=verbose
X-HTTP-Method: PUT
Body:
{ '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}
This throws various 400 errors. If the current owner of the group is a user, I get the error "The required property 'Email' does not exist in the message" - i.e. it wants SP.User properties. If the current owner of the group is another group, I get
the error "The required property 'AllowMembersEditMembership' does not exist in the message." - i.e. it wants SP.Group properties.
I've tried various adaptations of the three approaches above, such as specifying additional SP.Principal properties or passing SP.User or SP.Group objects instead, but with no success. Any ideas?As we chatted on email. There doesn't seem to be any combo that will set the owner. Only way to do it is to use the CSOM XML method and post to client.svc\ProcessQuery:
POST
http://weburl/_vti_bin/client.svc/ProcessQuery HTTP/1.1
X-RequestDigest: 0xAE382F0A8F11688BA9BE66739F84443892CE5E5452BA3E2622F6013D9D97EA8A8D9476463EDC503F700EB24F45024150D0DEEB2F40B160CD88BA7C7B4769BECD,15 Jan 2014 00:11:02 -0000Content-Type: text/xml
Host:
www.sanspug.org
Cookie: FedAuth=blah
Content-Length: 612
Expect: 100-continue
Accept-Encoding: gzip, deflate
XML body is:
<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
<Actions>
<SetProperty Id="45" ObjectPathId="32" Name="Owner">
<Parameter ObjectPathId="33" />
</SetProperty>
<Method Name="Update" Id="46" ObjectPathId="32" />
</Actions>
<ObjectPaths>
<Identity Id="32" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:a1452dcc-8fc4-4631-8ada-97cb204810f1:g:9" />
<Identity Id="33" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:a1452dcc-8fc4-4631-8ada-97cb204810f1:g:7" />
</ObjectPaths></Request>
The ids are randomly generated and can be anything you want, as long as they correlate (setproperty and method objectpathid is the object you are updating). The most important part is the
“Name” parts. The first part is the typeid of the object (in this case is means SPGroup), the second part as you can see if the site guid id. The response does in fact return json if you tell it too:
Chris Givens CEO, Architecting Connected Systems
Blog Twitter -
Extracting Raw Data Using Excel Services REST API
I am trying to create a home page in SharePoint 2013 that shows quick stats based on an Excel workbook stored in a document library. Through my research I found that I could leverage the Excel Services REST API to pull the information I need from the workbook
via URIs and display it on a SharePoint page in a seamless manner.
The problem I am having is pulling the data I need as raw text.
For example, I can create a page in HTML that says "Our sales for the month grew by [X%]" and use an img src tag that points to
http://sample.com/_vti_bin/ExcelRest.aspx/Documents/workbook.xlsx/Model/Ranges('Sheet1!A1')?$format=image to show a picture of cell A1 which contains the data I want to show inline on my page.
I want a way to pull the data in cell A1 as raw text so that I can format it as part of the HTML page. I tried using
$format=html, but that just takes me to a separate page where the cell is formatted exactly as it is in the workbook.
Is there a way to do what I am trying to do? The more detailed your response can be, the better as I am fairly new to these features. And also, is there a way to perform calculations of cells in HTML? Thanks in advance.Hi,
According to your description, you might want to extract text value from a specific cell in an Excel file using Excel Services REST API.
As there is no such predefined format can be used to return text value only, I would suggest you return the value as json format, then parse it and set to your HTML
tag using jQuery.
Here is a <p> tag with a script which can set the value of the <p> tag with the value gets from cell “A1”:
<p id="cell1">test</p>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
//replace the strings below with yours
var libName = "Shared Documents";
var fileName = "Book1.xlsx";
var rangeName = "A1";
$(function(){
var s = getCellValue(libName, fileName, rangeName);
$("#cell1").html(s);
function getCellValue (libName, fileName, rangeName)
var cell = "";
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_vti_bin/ExcelRest.aspx/"+libName+"/"+fileName+"/model/Ranges('"+rangeName+"')?$format=json",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
dataType: "json",
async: false,
success: function (data) {
console.log(data.rows[0][0].v);
cell = data.rows[0][0].v;
error: function (data) {
console.log(data);
return cell;
</script>
You can add it into your page via a Content Editor Web Part, it will take effect after the page loaded.
Here are two links about how to add code into page via Content Editor Web Part:
http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx
http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/
Best regards
Patrick Liang
TechNet Community Support -
Hi,
Is there a REST API available for CCW operations?
Thanks
KrishnaHi, do Cisco provide a REST API for accessing the CCW in the meantime?
Maybe you are looking for
-
Using my credit in the iTunes store when buying in iBooks for PC on my macbook?
I currently have and generally always maintain a credit balance in my iTunes store account. Can this be used when i buy iBooks in the iBooks app?
-
hi, i have a piece of code like the one below. please help be in optimizing it better. open vcursor for select *..........where..... loop fetch vcursor into .......a,b,c. var a = fn(a,b,c) 'place a in an array.. end loop.. is there a way to fetch eve
-
Migration: Access 2003 to Oracle SQL
Dear All I would like to perform a migration from Access 2003, to Oracle 10g. I am using SQL Developer for the task, and have reached the point of capturing the XML file that I exported from Access. I need to create a migration repository on the targ
-
SAP Services Terminates unexpectedly
Hello, Whenever I am executing SAP MMC to start SAP Servers, SAP MMC snap ins hangs and SAP services terminates unexpectedly with the following error in system event log. Sometimes the restarting the server will bring the SAP servers/services up. Kin
-
HI, What is the purpose of entry in table J_21RG1bal when any way we have to put a zero value entry of stock. what is the basic purpose of doing it?