
Giphy
The hard part often isn’t Python. It’s figuring out what the program needs to do first.
You can understand what an API is and still open a blank Python file with no idea what to write.
That gap is easy to underestimate.
Documentation explains endpoints. Tutorials show requests. Courses explain authentication and responses.
Then work gives you something like:
Pull this data from the application, check whether certain objects are present, and do something if they are.
Now the problem feels completely different.
Where do you start?
Which data do you need?
How do you get it?
What part of the response matters?
What happens after you find it?
The problem may not be that you don’t understand APIs.
The problem may be that nobody showed you how to turn a work requirement into a sequence a program can follow.
Start With the Job
Before worrying about Python, figure out what you are trying to accomplish.
Goal → Authentication → Request → Response → Extract → Action
That’s the workflow, the code comes afterward.
Goal
What are you trying to accomplish?
Keep this painfully simple.
Maybe the job is:
Check whether objects exist in an application that should not be there.
That’s already more useful than:
“I need to write an API script.”
One describes the work.
The other describes the tool.
Start with the work.
Authentication
Next:
How does the application know your program is allowed to access its data?
When you use a web console manually, you usually log in.
A program needs its own way to identify itself too.
Depending on the application, that might involve an API key, a secret value, a service account, or another supported authentication method.
A service account is simply an account meant for software or automated work instead of a person logging in and clicking around.
The details vary between applications.
The workflow doesn’t:
The system needs to know who is asking and what that identity is allowed to do.
This is also where judgment starts to matter.
The program should have the access required for its job.
Not unlimited access because it was easier to configure.
Request
Now the program needs to ask the application for something.
That request usually goes to an endpoint—the specific API address used for a certain type of information or action.
Don’t start by searching the documentation for every available endpoint.
Go back to the goal.
If the job is:
Check whether unwanted objects exist.
Then the question becomes:
Which API request gives us the objects we need to inspect?
Now the documentation has a purpose.
You’re not reading it hoping automation will somehow reveal itself.
You’re looking for the specific piece needed to move the workflow forward.
Response
The application sends information back.
This is where APIs can start looking intimidating.
The response might contain:
names
IDs
status
timestamps
descriptions
nested information
fields you have never seen before
a bunch of data that has nothing to do with your task
That’s normal.
The application may return far more information than your program needs.
A response isn’t a homework assignment where every field has to be understood before moving on.
Ask:
What did we need from this response to accomplish the goal?
Extract
This is the part that made API work much more practical.
You usually don’t need everything returned.
Maybe the application gives you 30 fields for each object.
Your task only cares about:
the object name
the object type
whether it exists
So pull out those pieces.
Store them in a variable if the program needs to work with them later.
Compare them against whatever rule or list defines what should be there.
Ignore the rest unless the job requires it.
That’s a big shift from looking at an API response and thinking:
“How am I supposed to understand all of this?”
You’re not.
You’re supposed to understand the part your task depends on.
Action
Now ask:
What should happen because of what we found?
Maybe:
create a report
send an email
create a ticket
write the result to a file
pass the value into another part of the program
trigger another API request
flag something for a person to review
This is where the program stops being “a script that calls an API” and starts becoming a useful workflow.
The API gave you access to the application.
Your program decides what to do with that access.
A Real Example
Say an engineer normally logs into a web console and checks whether certain configuration objects exist.
That work might look like this manually:
Log into the application.
Navigate to the right section.
Find the objects.
Check their names.
Compare them against what should exist.
Record anything unexpected.
Now translate that into the API workflow.
Goal
Find objects that should not be present.
Authentication
Give the program an approved way to access the application.
Request
Ask the API for the relevant objects.
Response
Receive the application's data.
Extract
Pull out the names or other fields needed for the comparison.
Action
Flag unexpected objects and create whatever output the team needs.
That’s the program before the program.
Once those steps are clear, Python starts becoming a tool for implementing decisions you have already made.
`
You Don’t Need to Become a Software Developer
There’s another trap here.
Network engineers sometimes look at automation and assume they need deep programming knowledge before doing anything useful.
You do need programming fundamentals.
Variables matter.
Lists and dictionaries matter.
Conditions matter.
Loops matter.
Functions matter.
Understanding errors matters.
But you do not need to master multiple programming languages before building something useful.
Python is a practical starting point because it is widely used in infrastructure and automation, and there is a large amount of documentation and example code around it.
Learn the fundamentals.
Then use them against a real problem.
That is usually more useful than spending months learning syntax without having a job for it to do.
The point isn’t:
Learn Python because Python is important.
The better question is:
What can Python help you stop doing manually?
Documentation Is a Reference, Not a Project Plan
Vendor documentation can tell you:
how authentication works
what endpoints exist
which fields can be returned
what a request should look like
what errors may come back
But documentation doesn’t know your work requirement.
It doesn’t know that your team needs to check certain objects every morning.
It doesn’t know which fields matter to your report.
It doesn’t know what should happen if the result is wrong.
That’s the engineering part.
The documentation tells you what the application can do.
You decide how those capabilities solve the work problem.
Before You Write the Next Script
Take one task you currently do manually.
Don’t open the code editor yet.
Write this down:
Goal
What am I trying to accomplish?
Authentication
How will the application know the program is allowed to do this?
Request
What information or action do I need from the application?
Response
What will come back?
Extract
Which part of that response actually matters?
Action
What should happen next?
If any of those boxes are unclear, that’s where the work starts.
Not with another Python tutorial.
Not with copying a sample request.
Not with trying to memorize every API term.
Make the workflow clear first. Then make the code follow it.
Until next time
— NEP
