RESTful API Documentation SUCCESS Strategy
Follow along, letter by letter, to learn the secrets to SUCCESS when it comes to RESTful API documentation.
Join the DZone community and get the full member experience.Join For Free
when defining an overall api documentation strategy, it means that this strategy should unify your api design and documentation, causing them to work together to produce a better developer experience.
the most important thing to remember is that most of the users/readers of your restful api are developers, or at least have some sort of technical knowledge, so the documentation strategy should be more technically oriented.
a few weeks ag,o i was reading a very interesting blog post by james higginbotham called building your api documentation strategy for success , i have decided to summarize his success strategy in our blog as well:
your api documentation strategy must first be software- or solution-focused. this basically means that your documentation should reflect your solution.
if your api and related documentation does not help developers and users solve problems, then you will struggle to gain adoption.
once the benefits are clear, the documentation must guide developers on how to perform the various activities to be done to achieve these benefits.
a solution-focused strategy means consistently finding ways to explain and emphasize the benefits that your api provides.
for example: saving time, reducing expenses, increasing revenue, and/or improving collaboration. your documentation's role is to keep these benefits in mind and always challenge the api design when it doesn't meet or exceed these expectations.
be clear, define your concepts, try to address everything up-front, reference strong points consistently throughout your documentation, and address areas that your api isn't intended to solve.
technical writers must strive to be clear about the concepts your api supports (and doesn't support). teams should define their domain concepts up-front. otherwise, one person's concept of a project is another person's concept of a team or a 'task.'
on a side note, most web apis expose resources that are named based on either the underlying domain model or database structures. when you surface these names without first defining your api's conceptual model, confusion will likely occur. this may be the result of misunderstanding by developers or something as simple as marketing terms creeping into the names of your resources, confusing developers on the meaning of resources.
case studies highlight applications that have been built using your api. provide examples and reference applications to demonstrate some of your api's capabilities.
provide a reference documentation for each api endpoint to developers, including details on the url, http verb(s) supported, response codes, and data formats. developers use this documentation when starting to consume api endpoints.
provide an overview of the api, addressing concerns such as benefits, concepts, capabilities, and the pricing of your api to qualify prospects. also, make your api discoverable so that it can be found outside your website.
guides offer help with learning an api, including its concepts and vocabulary during this critical stage. they also provide steps for implementing common use cases.
restful api help pages and faqs can guide new and experienced developers toward a better understanding of your api and proper usage patterns.
create internal documentation to help your support team when developers get stuck. these assets may eventually become public documentation over time.
one way to accomplish this is by hosting your documentation on github or other sites that allow for community improvement. we also suggest monitoring for posts and stories that document how someone used your api or struggled with your api, as these will provide greater insights into usage patterns and problems.
apis are, by their very nature, collaborative. developers inside and outside of your organization are using something you have built and shared. this means that it is important to find ways to allow your documentation to include community ownership.
finally, something that is often missed is promoting the products that are using your api. share what others are doing with your api on your website by capturing case studies (with their permission, of course). this helps them to gain recognition for innovating on your api and helps website visitors know that your customers are experiencing successes with your api.
many of us are familiar with api reference documentation tools, such as swagger, that offer interactive documentation. this nice-to-have feature is quickly becoming a required feature in documentation today. beyond this, however, lies a whole other opportunity for expanding your documentation to engage all types of audiences:
demos for interacting with your api to perform a task or see it in action, videos for demonstrating api capabilities and value to non-technical decision makers.
tools such as postman allow for collections of api requests with sample payloads to be exported and shared with developers to accelerate learning.
while api documentation should be focused toward external problems, it can also help drive your internal strategy. this includes marketing and sales, which will better resonate if it aligns with your api concepts and solutions. api documentation can also drive search engine optimization (seo) for organic growth.
api documentation may also drive key performance metrics, specifically customer acquisition costs (cac) and customer lifetime value (ltv). a well-executed documentation strategy will decrease the customer acquisition costs (cac), as it will require fewer sales and support staffers to close and onboard the customer. it will also increase customer lifetime value (ltv), as you will be able to increase retention and reduce customer churn.
don’t overlook your api documentation strategy when defining and tracking your api metrics. it can have a positive impact on your overall product strategy.
tool selection should match the technical skills available on the team. for example, if you have team members who aren't comfortable with github, then you may have to invest time training them or select something else that is a better fit, such as wordpress. whatever you select, it should have minimal friction to encourage updates from team members.
it is important to select the right tools that the team will use to keep the documentation fresh and up-to-date with the latest api changes.
sustainable documentation is as important as code deliverables — perhaps moreso. without current documentation, no one will know how to best use your api.
Published at DZone with permission of Guy Levin, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.