Question: I have a list 'choiceOpt' which contains a choice field 'choiceOptions' having Yes ad No as options.

I want to retrieve this Yes and No programmatically (javascript) .

Kindly help.

Answer: 
After the first query that creates `Folder` object you could perform the `second` REST request: 

```
http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/listItemAllFields

```

to retrieve the associated `List Item` with a `Folder`.

The following JavaScript example demonstrates that approach:

```
function executeJson(url,method,additionalHeaders,payload) 
{
    var headers = {};
    headers["Accept"] = "application/json;odata=verbose";
    if(method == "POST") {
        headers["X-RequestDigest"] = $("#__REQUESTDIGEST").val();
    }   
    if (typeof additionalHeaders != 'undefined') {
        for(var key in additionalHeaders){
            headers[key] = additionalHeaders[key];
        }    
    }    

    var ajaxOptions = 
    {       
       url: url,   
       type: method,  
       contentType: "application/json;odata=verbose",
       headers: headers
    };
    if(method == "POST") {
      ajaxOptions.data = JSON.stringify(payload);
    }  

    return $.ajax(ajaxOptions);
}

function createFolder(webUrl,folderUrl) 
{    
    var url = webUrl + "/_api/web/folders";   
    var folderPayload = { '__metadata': { 'type': 'SP.Folder' }, 'ServerRelativeUrl': folderUrl}; 
    return executeJson(url,'POST',null,folderPayload).then(function(data){
            var url = webUrl + "/_api/web/GetFolderByServerRelativeUrl('" + folderUrl  + "')/ListItemAllFields";
            return executeJson(url,'GET');
        });
}

```

Usage 

```
createFolder(_spPageContextInfo.webAbsoluteUrl,'/Shared Documents/Archive')
.done(function(data)
{
    var folderItem = data.d;
    console.log(folderItem.Id); //print ListItem.Id property
})
.fail(
function(error){
    console.log(JSON.stringify(error));
});

```
I've found using the following GetByUrl or GetFolderByServerRelativeUrl with a number of folders can lead to the below.

"The length of the URL for this request exceeds the configured maxUrlLength value."

By using GetFolderById('guid')/listItemAllFields I was able to accomplish my task of assigning permissions and updating a field.