Glossary

ProgrammableWeb's glossary of API and other technology terms and defination
A B C D E F G H I J K L M N O P Q R S T U V W X
Sample Code

Sample Code refers to software code provided for demonstration purposes. Sample code often accompanies documentation to help a developer become familiar with using a framework or service. Sample code may range from minor code snippets to complex applications. Sample code is especially crucial for APIs because it can showcase how to integrate with an API from a specific language or environment. For example, API developer documentation often shows what an HTTP request looks like in cURL, Python, Go, JavaScript, Java, C++, or other programming languages, helping developers build an integration within their local applications more easily. Code snippets may indicate what a request package looks like, the methods and endpoints called, the headers used, required fields, and authentication measures. Sample responses are common as well. For REST APIs, sample responses are typically structured in JSON, a common format for interchanging data over HTTP.