I plan to use some code licensed under Apache License 2.0 in some API. How shall I include the license notice that is required by Apache License 2.0? The API is a RESTful API, which is documented on a webpage. Shall I simply add the license notice somewhere on the same webpage?
You have taken some code licensed to you under Apache2 and made a derivative work implementing an API. You intend to run a single instance of this work on your own server so that others can interact with it. You wish to know what your licence obligations are.
Basically, as I read it, you have nearly none. All the obligations of Apache2, including preservation of the licence text and inclusion of any provided
NOTICE file, are in s4, which begins:
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions
You aren't distributing copies of your derivative work. You have reproduced a single copy, but as long as the server-side code contains, somewhere, text that satisfies the requirements of s4, you have met your obligations.
Most free software licences only impose obligations when code is transferred to another party. The desire to extend the benefits of these obligations to people who were merely interacting with the software over a network was a major factor in developing the AGPL, and the AGPL remains unusual among free licences in extending your obligations to people who merely interact with covered code running on your server.