1

Hi guys this is a question based on a scenario.

Implementing autocomplete widget where it,

  • fetch data from backend
  • render results as a tree
  • support for radio, checkbox , icons

In here what does the component's API looks like?

what does the backend API looks like?

I know what is an API but this makes me really confusing.

asked Dec 30, 2020 at 5:41
2
  • 1
    There's "API" as in "the interface for the object you define in JavaScript" and "API" as in "external resource over HTTPS, etc.", but it's not clear which you're talking about. Commented Dec 30, 2020 at 5:43
  • @tadman not sure but these are the questions asked. I'm also not clear what they meant. Commented Dec 30, 2020 at 11:45

1 Answer 1

2

(Disclaimer: gross oversimplification here)

API is just a way of how computers speak to each others in a very structured way.

Component's API is usually a signature of some modules/packages/functions. In other words, it's an explanation of how to interact with a component. Note, that the component can be very complex inside, but provide a very clean and easy to use API. This API describes how to use the component, what arguments to provide, what you get when running it, etc. Here is an example of a component's API - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date (in this case it's a JavaScript Date object)

A backend API is the same contract/way of interacting, but over network, like REST API or GraphQL. Backend API defines which urls/ips you need to connect to, what to send to them, and what to expect. Here is an example of BE API - https://www.teslaapi.io/vehicles/list (in this case it's Tesla's public API)

answered Dec 30, 2020 at 5:46

1 Comment

I think this is made it bit clear to me. I will accept this after few more days and if there are other answers to this and after referring to them also. Meanwhile can you explain this using the scenario because it makes clear for others and me also to understand how to properly answer this questions based on a scenario.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.