0

I am using Google Chromes Advanced REST Client to try some REST calls to SharePoint and Project Server.

I managed to read the data with a simple GET. I get an XML back that has all the properties for the given object. For instance if there's a Project object, this would have a Project Name property.

<entry xmlns....
    ....
    <m:properties>
       <d:ProjectName>Test Project </d:ProjectName>
       ... a lot more properties ...
    </m:properties>
    ... *some other tags* ...
</entry>

I would very much like to update this Project Name, and in the SDK I read that the Project object supports the DELETE, MERGE, PUT methods. I've read that the MERGE one is the one which allows the user to only update selected properties without taking effect on others. The Advanced REST Client however does not have a MERGE, but it has a PATCH.

How should I construct the request, the headers and how should I specify the new name for the project?

I tried to write in the following in the Payload section of the request:

{"ProjectName"="New Name"}

It came back with a 403 (Forbidden) error.

Laureant
  • 979
  • 3
  • 18
  • 47
  • Do you have write access to the list? Also, your payload is weirdly formatted. What are you trying to send, JSON? – Daniel B Aug 19 '15 at 11:45
  • I have write access. I am completely new to this type of programming. I just want to somehow post back to the site, so I will be able to change the data (ProjectName propery) – Laureant Aug 19 '15 at 11:55
  • Do you want to change this only once, or are you planning on doing this for many lists? Because even though using a REST client works, it would be more suitable for some custom code. If you're only doing this once, why not edit the list from SharePoint itself? Just curious! =) – Daniel B Aug 19 '15 at 11:58
  • I want a custom mobile application that does this using the REST interface. So it would mean I would do this action many times. I made another payload, but still not working: "{"d"={"__metadata":{"PercentComplete":100}" – Laureant Aug 19 '15 at 12:10
  • Well, this question is really broad so there is no easy way to answer. You're on the right track, but you have to specify the `content-type` aswell as the `RequestDigest` value to be able to update your list item. You should look at [this](https://msdn.microsoft.com/en-us/library/office/jj164022.aspx) and return with a more specific question if you cannot get it to work with code. – Daniel B Aug 19 '15 at 12:36

0 Answers0