The following example is based on the REST API provided by Spotify (using a free account). The goal of this process is to get the content of a private playlist named Classical that exists in my account, and to do that the application must be authorized.
The details of this process will vary slightly between APIs; the lessons learnt here can be translated to many different web APIs. For example, GitHub implements a very similar process to support OAuth: