Skip to main content

API Documentation Template for submodules

This template page is adapted from https://github.com/dr5hn/csc-website/blob/main/docs/api/country.md.

Create one markdown page for each submodule (audio, vision, ...) and document its APIs. Always including the following items.

  • The commands needed to run the submodule.
  • Exposed external interfaces (topics, services and actions) expected to be called by other submodules.
  • Important launch files and its parameters.

Overview

Topics

List all the topics here.

TopicDescriptionNodeMessage Type
/topic1Desc1.node1geometry_msgs/PointStamped
/topic2Desc2.node2geometry_msgs/PointStamped

Topic1

Specify publish rate (or conditions), and other important information. Provide example usages if possible.

Topic2

Services

Actions

Example Usage

countries-states-cities.js
var headers = new Headers();
headers.append("X-CSCAPI-KEY", "API_KEY");

var requestOptions = {
method: 'GET',
headers: headers,
redirect: 'follow'
};

fetch("https://api.countrystatecity.in/v1/countries/IN", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Example Success Response

{
"id": 101,
"name": "India",
"iso3": "IND",
"iso2": "IN",
"phonecode": "91",
"capital": "New Delhi",
"currency": "INR",
"native": "भारत",
"emoji": "🇮🇳",
"emojiU": "U+1F1EE U+1F1F3"
}