I have a client app that uses the Office 365 SharePoint preview API. Recently (as of October 2014), Microsoft published version 1.0 of that API. The authentication steps used with the preview API no longer work with version 1.0.

To demonstrate the problem I have created a short node.js script. The script does the following:


Authorizes by launching a browser. Gives a redirect URL to localhost and launches a server to catch the redirect post-authorization
POST to https://login.windows.net/common/oauth2/token to get an access token
GET to the Office 365 discovery service to get the SharePoint API endpoint
POST to https://login.windows.net/common/oauth2/token with a refresh token to get a new access token
GET to the SharePoint API endpoint to get a list of files


The script can be used with the preview API and version 1.0 of the API. It is able to get a JSON list of files from the preview API, but fails with the following for version 1.0 (on the last call):


{
    "error": {
        "code": "-2147024891, System.UnauthorizedAccessException",
        "message": "Access denied. You do not have permission to perform this action or access this resource."
    }
}


Does anybody see anything wrong with the sequence of calls?

Please take a look at the sample script for more details.


Question: Url link to feature image in the portfolio
Answer: I think it is possible with custom fields.

Add a custom fields, for example, named link. Put the link into the value field. Then you will be able to access it something like that:

&lt;a href="&lt;?php echo get_post_meta( get_the_ID(), 'link', true ); ?&gt;"&gt;
    &lt;?php the_post_thumbnail(); ?&gt;
&lt;/a&gt;