What is the proper process to integrate a third party api in exiting php project
So this is a very weird question but i want to know the effective way to integrate a third party api because this is where i have problem- So let's say i need to integrate a instagram third party api which dm people ( purely hypothetical api may not exist)
So what i will do first is create a new project and try to write a function that will take variables needed( i will for now pass them as random test variables) and make a curl request and check if its working.
When i get my function to be working i will create this function in my php project. Then the area of code where i want my code to send dm to insta users i will call this function and if variables are missing then try to fill them into parent function and use in child( my own function i am using inside it).
If that part does not exist so i will directly call my new function passing required variables.