# Introduction to REST API

**URL:** https://forum.networklessons.com/t/introduction-to-rest-api/8357
**Category:** Lessons Discussion
**Created:** [September 26, 2019, 6:29pm UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357 "2019-09-26T18:29:56Z")
**Posts on this page:** 15
**Page:** 2

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [October 12, 2021, 7:59am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/21 "2021-10-12T07:59:45Z")

</div>

Hello Nicolas

> [@nicolas.khalaf](#):
>
> 1- Why an API REST need a token, it could not use the authentification method to get or update the info?

REST has no built-in security features, however, there are several ways you can secure it. One way is to use token-based authentication, as seen in the lesson. However, this is not the only method. You could use HTTPS with TLS encryption as an option as well.

> [@nicolas.khalaf](#):
>
> 2- the token value is always the same or it can change with time?

Typically, tokens are valid for a particular period of time. After this time expires, they are considered invalid and require a refresh token. This is a new access token that replaces the old one. How often this is done depends on the configuration. More info on refresh tokens and expiry durations can be found in this Cisco documentation:

> **[Cisco Secure Firewall Threat Defense REST API Guide - Authenticating Your
	...](https://www.cisco.com/c/en/us/td/docs/security/firepower/ftd-api/guide/ftd-rest-api/auth-ftd-rest-api.html#task_19B425A0A6C340BC859E89BCC155F67C)**
>
> Authenticating Your REST API Client Using OAuth

> [@nicolas.khalaf](#):
>
> 3- the server IP is the ip used in the static default route configured on the router?

In this setup, H1 is the client, and R1 is the server. So the IP of the server is the IP of the Gi/2 interface on the router, which is 172.16.1.100. The IP address in the default route is that of H1. This is set up like this only for the purpose of the lab. You wouldn’t see such a default route pointing to a host in a production network.

I hope this has been helpful!

Laz

PS, thanks for pointing out the typo, I’ll let Rene know!

---

<div class="post-metadata">

### Author: ![nicolas.khalaf](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/n/a183cd/32.png) [@nicolas.khalaf](https://forum.networklessons.com/u/nicolas.khalaf)
#### Post date: [October 14, 2021, 11:10pm UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/22 "2021-10-14T23:10:38Z")

</div>

Thanks a lot Laz, always clear and helpful answers!

---

<div class="post-metadata">

### Author: ![pavanc.08](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/p/977dab/32.png) [@pavanc.08](https://forum.networklessons.com/u/pavanc.08)
#### Post date: [October 18, 2021, 6:20pm UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/23 "2021-10-18T18:20:49Z")

</div>

HI

ASRx routers will support this virtual service?

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [October 20, 2021, 5:12am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/24 "2021-10-20T05:12:23Z")

</div>

Hello Pavan

The ASR 9000 does support the virtual service option with release 5.1.1 or later as described in this document:

> **[Cisco IOS XR Software (End-of-Sale) - Support](https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xr-software-end-of-sale/series.html)**
>
> Introduction

The ASR 1000 with IOS XE Everest 16.5 also supports virtual service as seen here:

> **[Cisco IOS XE 16 - Support](https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-16/series.html)**
>
> Cisco IOS XE 16 - Technical support documentation, downloads, tools and resources

However, for the ASR 900 and 920 I was unable to find any indication that this is supported. Your best bet is to take a detailed look at the Cisco Feature Navigator found at the following link, and take a look at specific IOS and platforms to ensure what features are available on what devices.

> **[Cisco Feature Navigator](https://cfnng.cisco.com/)**

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![parnett](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/p/41988e/32.png) [@parnett](https://forum.networklessons.com/u/parnett)
#### Post date: [June 21, 2024, 10:51am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/25 "2024-06-21T10:51:46Z")

</div>

Hello, I am trying to clone your public repo but get a server certificate error. I am on a WSL instance on my windows laptop.

Cloning into ‘csr1000v-rest-api’…  
fatal: unable to access ‘[https://gitlab.com/networklessons-content/csr1000v-rest-api.git/](https://gitlab.com/networklessons-content/csr1000v-rest-api.git/)’: server certificate verification failed. CAfile: none CRLfile: none

Is this my issue or the servers?

Thanks,

---

<div class="post-metadata">

### Author: ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)
#### Post date: [June 24, 2024, 1:44pm UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/26 "2024-06-24T13:44:42Z")

</div>

Hello Peter,

That looks like a gitlab issue. What git clone command did you try?

On the repo page there are the SSH and HTTPS options:

> **[lessons / csr1000v-rest-api · GitLab](https://gitlab.com/networklessons-content/csr1000v-rest-api)**
>
> This repository contains python files to interact with the Cisco CSR1000V REST API.

This should work without configuring anything:

`git clone https://gitlab.com/networklessons-content/csr1000v-rest-api.git`

---

<div class="post-metadata">

### Author: ![alepaslopez](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@alepaslopez](https://forum.networklessons.com/u/alepaslopez)
#### Post date: [July 9, 2024, 7:14pm UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/27 "2024-07-09T19:14:36Z")

</div>

Hello,

I have some CAT9400 series running 17.09.04a and unlike CSR1000v I can’t see an option to download the corresponding install package “IOS XE Remote Management Software”. Is this still supported? if not what is the alternative. What would be the right ova to use here `virtual-service install name csr_mgmt package bootflash:/iosxe-remote-mgmt.XX.XX.XX.ova` for IOS-XE 17.09.04a. Please let me know and thank you

CSR1000v ova: [https://software.cisco.com/download/home/284364978/type/286283116/release/16.9.3?catid=null](https://software.cisco.com/download/home/284364978/type/286283116/release/16.9.3?catid=null)

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [July 15, 2024, 7:09am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/28 "2024-07-15T07:09:13Z")

</div>

Hello Alejandro

The REST API is supported only on specific platforms such as the CSR 1000V and the ASR1000 series routers. You can take a more detailed look at what is supported here:

> **[Feature History and Supported Platforms - Cisco IOS XE REST API Management...](https://www.cisco.com/c/en/us/td/docs/routers/csr1000/software/restapi/restapi/RESTAPIintro.html#47457)**
>
> For each Cisco IOS XE release supporting the REST API, the following table describes: | For supported platforms, the Cisco IOS XE REST APIs provide an alternative method to the Cisco IOS XE CLI to provision selected functions.

Keep in mind that according to [this Cisco Documentation](https://www.cisco.com/c/en/us/td/docs/routers/csr1000/software/configuration/b_CSR1000v_Configuration_Guide/b_CSR1000v_Configuration_Guide_chapter_01101.pdf), even for the supported platforms, REST API is supported only for IOS XE versions up to 16.6. REST API is not supported from the IOS-XE 16.7.x release onwards. If you are using the 16.7.x version or above, Cisco recommends that you use [Restconf](https://networklessons.com/network-automation/device-programmability#RESTCONF).

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![parnett](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/p/41988e/32.png) [@parnett](https://forum.networklessons.com/u/parnett)
#### Post date: [July 22, 2024, 11:58am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/29 "2024-07-22T11:58:03Z")

</div>

I think my issue was a work laptop as I’m sure i did that. Don’t know any other way to do it.

Works on home computer.

---

<div class="post-metadata">

### Author: ![davidilles](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/davidilles/32/9686_2.png) [@davidilles](https://forum.networklessons.com/u/davidilles)
#### Post date: [March 30, 2025, 10:28am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/30 "2025-03-30T10:28:01Z")

</div>

Hello.

A simple question here, I need some clarification regarding what an API is.

I understand that it’s some piece of software that allows applications or devices to communicate. I suppose that I can use socialblade as an example here  
 ![obrázok]()

SocialBlade is a website that provides statistics about various YouTube channels. So does this mean that YT has its own API that is available to public, therefore SocialBlade can use it to extract all this information from the YT database?

In this context, what exactly is an API? Did YouTube program something into their application that allows other websites to extract information from it?

So I suppose that a similar concept exists in the concept of network devices. There is some sort of API configured on them that allows us, the network engineer/programmer to extract information from it. Or in the case of SDN, the controller could use the API to extract/configure information from the device.

Thank you.  
David

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [April 1, 2025, 6:14am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/31 "2025-04-01T06:14:22Z")

</div>

Hello David

First of all, let’s address the question about SocialBlade. Yes, [YouTube provides a public API](https://developers.google.com/youtube/v3) that allows services like SocialBlade to access platform data programmatically.

YouTube’s API is a controlled interface between its internal database and external applications. SocialBlade sends structured requests to specific API endpoints. For example, to fetch subscriber counts or video metrics, SocialBlade might use something like this:

```auto
GET https://www.googleapis.com/youtube/v3/channels?part=statistics&id=CHANNEL_ID&key=API_KEY

```

This returns data in standardized formats like JSON, which SocialBlade then parses for processing and display. This allows YouTube to safely provide the information it chooses to third parties like SocialBlade, in a structured and controlled manner without the need to allow them to interact with internal databases and systems.

> [@davidilles](#):
>
> In this context, what exactly is an API? Did YouTube program something into their application that allows other websites to extract information from it?

Yes, that’s exactly it. Of course, this is simply one example of what an API can do. More generally speaking, an API is a well defined interface through which programs/software can gain access programmatically to interact with that system in a controlled and structured manner.

> [@davidilles](#):
>
> So I suppose that a similar concept exists in the concept of network devices. There is some sort of API configured on them that allows us, the network engineer/programmer to extract information from it.

Yes. In the example of SocialBlade, the purpose of the API is to simply extract information in a particular way. But APIs can be configured to provide deeper interaction between the system providing the API and the system using the API. For example, VoIP telephony systems that I’ve worked with provide predefined APIs that allow deep interaction with Customer Relationship Management (CRM) systems allowing the direct correlation of phone numbers with customer names. Similarly, APIs on network devices like routers and switches and firewalls can provide anything from extracting information, to full control and configuration using network management systems. So in the case of SDN, not only can you extract information, but you can have full control of the device. Not through CLI, but through a network management and controller system like Cisco DNA Center, which uses APIs extensively.

So an API is a programmatic interface through which another software program/process can interact with the system in question. The extent of interaction depends upon the configuration of the API itself. Does that clarify things a bit?

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![davidilles](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/davidilles/32/9686_2.png) [@davidilles](https://forum.networklessons.com/u/davidilles)
#### Post date: [April 1, 2025, 4:41pm UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/32 "2025-04-01T16:41:42Z")

</div>

Hello Laz.

It’s all clear now. I don’t think that things will be ever 100% clear considering the fact that I don’t program or create any APIs and seeing the background process would surely help, but at this CCNA/CCNP level, it’s more than enough.

So what’s the better option if we want to either configure or extract information from devices? Use an API or SSH/Telnet/SNMP (since SDN allows that approach as well).

David

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [April 3, 2025, 5:29am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/33 "2025-04-03T05:29:18Z")

</div>

Hello David

I understand, I too am not as involved in programming, so the lack of practical experience can hinder us from fuller understanding. In any case, you’re right, reaching this level of understanding for the purpose of certification is indeed enough.

> [@davidilles](#):
>
> So what’s the better option if we want to either configure or extract information from devices? Use an API or SSH/Telnet/SNMP (since SDN allows that approach as well).

It all depends on what you want to do, how much detail you want to get into, and how much time you want to spend arranging it. If you want a “quick and dirty” solution, it’s preferable to use predefined setups from network monitoring systems, using SNMP. If you’re using SDN, and there are predefined templates that can be used with SSH (not Telnet due to security concerns), then that would be the way to go.

If you want to have a more customized result, and you have the time, manpower, software tools, and expertise available, you can design specific APIs to do whatever you like, as far as configs and extractions go.

If you use Cisco DNA Center, it has many predefined APIs built in that allow you to streamline the implementation, giving you more options for the type of interaction you can achieve between the controller and the network devices.

So there are many options, all of which depend upon your requirements and the availability of specialized tools and skillsets. Does that make sense?

I hope this has been helpful!

Laz

---

<div class="post-metadata">

### Author: ![davidilles](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/davidilles/32/9686_2.png) [@davidilles](https://forum.networklessons.com/u/davidilles)
#### Post date: [June 4, 2025, 11:52am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/34 "2025-06-04T11:52:29Z")

</div>

Hello, everyone.

I have a quick question.

I don’t quite understand what Representational means in REST. Rene says that we transfer the representation of a resource. So not the actual resource itself, or what exactly is this representation? What is used to represent the resource?

Thank you.  
David

---

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [June 27, 2025, 4:39am UTC](https://forum.networklessons.com/t/introduction-to-rest-api/8357/35 "2025-06-27T04:39:41Z")

</div>

Hello David

When we talk about REST (Representational State Transfer), and specifically about representations of resources, here’s what we mean.

A resource in REST is an abstract concept. It’s typically a piece of data or information object identified by a URI. For example, this:

`/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1`

might identify the interface named GigabitEthernet1 on a device. This resource could have several properties — name, description, IP address, status, etc.

The representation is how the resource is encoded or presented over the network. It’s not the actual resource itself. Think of it as a snapshot of the current state of that resource. This representation is what is actually transferred in RESTCONF.

So the representation of that resource (i.e. the structured URI) is transferred. Does that make sense?

I hope this has been helpful!

Laz

[Previous page](https://forum.networklessons.com/t/introduction-to-rest-api/8357.md?page=1)
