4

I am working on SharePoint notifications using webhooks. I tried the following POST request.

https://xxxxx.sharepoint.com/_api/SP.AppContextSite(@target)/web/lists('2c955ea0-28h4-4f84-a8b5-001df9be12b')/getitembyid(93)?@target='https://xxxxx.sharepoint.com/sites/yyy'

I am getting the following response:

<d:ContentTypeId>0x0101007C119F47C066B746A51B6B65706817AZ</d:ContentTypeId>
        <d:ComplianceAssetId m:null="true" />
        <d:Title m:null="true" />
        <d:SharedWithUsersId m:null="true" />
        <d:SharedWithDetails m:null="true" />
        <d:ID m:type="Edm.Int32">93</d:ID>
        <d:Created m:type="Edm.DateTime">2020-02-03T13:35:24Z</d:Created>
        <d:AuthorId m:type="Edm.Int32">15</d:AuthorId>
        <d:Modified m:type="Edm.DateTime">2020-02-04T04:39:19Z</d:Modified>
        <d:EditorId m:type="Edm.Int32">17</d:EditorId>
        <d:OData__CopySource m:null="true" />
        <d:CheckoutUserId m:null="true" />
        <d:OData__UIVersionString>13.0</d:OData__UIVersionString>
        <d:GUID m:type="Edm.Guid">10c64759-2e1c-47ce-9985-2e394b6a59bb</d:GUID>
    </m:properties>
</content>

Is there any way to get editor detail using editor ID?

2 Answers 2

3

Try using below endpoint:

/_api/SP.AppContextSite(<host web url>)/web/lists('2c955ea0-28h4-4f84-a8b5-001df9be12b')/getitembyid(93)?$select=Title,Editor/ID,Editor/Title&$expand=Editor

OR:

Get a user from a site by id:

/_api/SP.AppContextSite(@target)/web/getuserbyid(16)?@target='<host web url>'

Where 16 is user ID.

Get a user from a site by login name:

/_api/SP.AppContextSite(@target)/web/siteusers(@v)?@v='i%3A0%23.f%7Cmembership%7Cuser%40domain.onmicrosoft.com'&@target='<host web url>'

Source: User resource - Supported HTTP methods.

0
2

You can use the below rest on success of your request in the question using the EditorId.

/_api/SP.AppContextSite(@target)/web/getuserbyid(EditorId)?@target='<host web url>'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.