انتقل إلى المحتوى
أمين أبوزيد
BEG-053

أساسيات API

  • 6 درس
  • 61 دقيقة قراءة
  • 2 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • مفاهيم REST
  • تصميم نقاط النهاية (endpoints)
  • Postman
  • أمثلة على الطلب/الاستجابة

تعلّم أولًا

61 دقيقة قراءة · 2 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Explain what an API is and the REST idea of resources.
  2. Read API documentation and make requests to a public API with Postman and curl.
  3. Sketch endpoint designs (URL + method + status) for a simple resource.

الدروس

  1. 01ما هي API10 د قراءة
  2. 02REST بلغة بسيطة10 د قراءة
  3. 03جولة في Postman10 د قراءة
  4. 04curl من الطرفية10 د قراءة
  5. 05رسم نقاط نهاية (endpoints) لمورد11 د قراءة
  6. 06عرض عملي: استكشاف API عامة باستخدام Postman وcurl10 د قراءة

المختبر والتمارين

Lab

BEG-053-LAB1 · API explorer

Outcomes: 1–3 · Time: ~2 h Call a public API for a list, a single item, and a filtered query; save a Postman collection; then sketch the endpoints a Library API would need. Acceptance: collection exported; endpoint sketch reviewed.

Exercises (assessment: endpoint design exercise)

IDOutcomeTask
BEG-053-EX011Explain what an API is to a non-programmer in three sentences.
BEG-053-EX021Name the resources in a school system and write their URLs.
BEG-053-EX031Fix these URLs: /getBooks, /createMember, /book/delete/7.
BEG-053-EX042Call a public API with Postman and with curl; compare the responses.
BEG-053-EX052Read an API's docs and call one endpoint with a query parameter.
BEG-053-EX063Sketch endpoints (URL, method, status) for members.
BEG-053-EX073Sketch an endpoint for "loans of one member" and for "overdue loans".
أظهر الحلول
  • EX01 An API is a menu of requests a program may make to another; the provider decides the rules and hides the inside.
  • EX02 /students, /teachers, /courses, /students/5/enrollments.
  • EX03 GET /books, POST /members, DELETE /books/7.
  • EX04 Same data; curl -i also shows status and headers.
  • EX05 For example GET /items?limit=5; check status 200.
  • EX06 GET /members 200; GET /members/{id} 200/404; POST /members 201/400; PUT /members/{id} 200/404; DELETE /members/{id} 204/404.
  • EX07 GET /members/{id}/loans; GET /loans?status=overdue.

الاختبار

Outcomes: O1 API and REST resources · O2 Postman and curl · O3 endpoint design.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1An API is:O1
  2. 2In REST, URLs should be mainly:O1
  3. 3Which URL is best?O1
  4. 4In curl, -H is used for:O2
  5. 5curl -i shows:O2
  6. 6A Postman collection is:O2
  7. 7A 404 from a documented endpoint most likely means:O2
  8. 8Endpoint to create a book:O3
  9. 9Status for a successful create:O3
  10. 10Filtering by author is best done with:O3

الجزء العملي

Endpoint design exercise: sketch the Library API endpoints (EX06–EX07) and export the Postman collection (lab). Pass: at least 8 of 10 quiz questions and a reviewed sketch with no verbs in URLs.

أخطاء شائعة

Verbs in URLs (/getBooks).

التقييم

Endpoint design exercise.

الصلة بالمسار الوظيفي

The Junior capstone builds exactly such an API (JNR-018).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.