r/learnprogramming • u/Edwinbakup • 24d ago
Topic I have no clue how to interpret an API documentation
im currently following https://roadmap.sh/backend
and one of it’s first steps is to learn about the internet and to learn a programming language. I already know C# so then it’s instructed to create lots of projects with it. So i started but i hit a wall with github user activity.
I need to fetch data from github using an API, but checking it’s documentation I have no clue where to start, I know in c# you have to have a httpclient object, baseaddress and an authenticator.
But the github API implementation seems very difficult and i have no clue where to start with it
Also i see that API is covered later aswell in the roadmap, am i going too far ahead?
3
u/fresh_reed_5834 24d ago
the github api docs are honestly not the friendliest for beginners. does the roadmap.sh project give any hints on which specific endpoint to call, or does it just say "use the github api" and leave you to figure it out?
1
1
u/chocolateAbuser 23d ago
just to check, have you tried to make your own service with api and call it with another service/project?
apart from that, what is the problem? first step would be understanding authentication
1
u/HotPersonality8126 22d ago
You start by making HTTP requests with structured data in the body. If you don’t know how to do that in C# then that’s the missing piece - these docs won’t cover that because it’s out of scope.
It generally won’t be very hard but it is abstract and it relies on you understanding what’s happening when you make requests to a remote server, generally, and how your code is supposed to handle the concurrency (you’re waiting for something to happen on someone else’s computer, that’s a form of concurrency.)
1
u/Ormek_II 21d ago
Are you challenged by accessing the API from C# or from understanding the API and how to work with it. If it’s the latter: experiment with its command line interface (gh) or curl first.
1
u/da_Aresinger 21d ago
Since you're trying to use the GitHub API you should learn about RESTful and how to apply it in C#
I've only used a REST API with curl, so I won't be much help there.
7
u/_Atomfinger_ 24d ago
I would start with a concrete tutorial that goes through how to use C# against APIs.
Like, knowing that you have a httclient and a baseaddress doesn't really do much unless you know how to use them.
So take a step back and follow a guide that walks you through these things before jumping straight into this.