First of all, you shouldn't be embarrassed of anything you do. In this field everyone's constantly learning. I think of API like a "thing" that helps applications communicate with each other. Usually people associate these with some json/xml data involved but that doesn't have to be 100% true. You can think of packages as APIs if they help implementing a 3rd party service for example. Take Stripe, Paypal, etc... The easiest definition I can think of is a tool that helps transferring data between 2 applications.
Will somebody PLEASE explain API?
I know many of you will be like 'Oh c'mon you don't know about apis and you are working in laravel'. Well my fellows, yes I have a loooot of confusion about this API thing.
You see, all this time I thought that API is used when we want to add third party functionality in our project or we can create an api of our own project so others can utilize our project's functionality (Please correct me if I am wrong.)
Kindly note that I am at a very beginner/basic level in laravel app development and I have developed some basic applications. And I have not used any third party APIs (Facebook api etc.) or haven't created any API myself. Although I have used some packages in my projects like google2FA..
Can we consider Packages as an API?
Well the other day, someone I know (who is a Senior Laravel Developer) asked me about my project and I told him that I am working on a human resource management project then he asked me how many apis have you created in this project and then I was like "I have NO IDEA what you are saying.." . Anyway I told him that I haven't created any API yet.
So my question is, you guys have any idea what he was talking about? what apis? I know should have asked him this but tbh I was too embarrassed to ask.
Thanks for bearing with me.
API can be any agreed interface between two things
So, the methods you expose in a package is your packages API - the ways others can interact with the package
Third parties can have APIs that you want to access to get from or set data on their service - again, the API determines the ways you can interact with the service
Your own application can have an API - the ways that your clients can interact with your application
Think of it like a border. Whenever something passes from one area of responsibility to another you need an API to agree how the two parties will interact with each other.
Please or to participate in this conversation.