Get Site Content Type ID by Content Type Name using REST API

I am having some of the Site Content Types available in my SharePoint 2013 site. Now I want to assign this Site Content Types to my Document Library using REST API.

I have tried code from here and it worked perfectly. But the only problem is it required Content Type ID to associate and I am just having Site Content Types name.

So I just want to know is there any REST end point available through which I can associate my Site Content Type to my library using Name instead of ID?

I am bound to use REST API only.

Replay

You can get content type id from its name. Just you have to use $filter.

"/_api/web/AvailableContentTypes?$select=Name,Id,StringId&$filter=Name eq 'Your CT Name'"

Just make a GET request to the above end-point.

PS: Id is a object. So better you can consider to $select StringId in your query.

Category: sharepoint server Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.174 (s). 12 q(s)