Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9165199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:51:22+00:00 2026-06-17T14:51:22+00:00

I am stuck on how I should be structuring my URLs for a RESTful

  • 0

I am stuck on how I should be structuring my URLs for a RESTful API I am developing.
My problem comes from the fact that sometimes I need to get several joined tables from a single call.

In one instance, I need to get two tables. I have a table named courses, and a table named topics. I need to get the course_name row and then all the topics that belong to that course.

In another instance, I need to get three tables. I need to join the topics to the parts to the bullet_points table

How should I refer to these in the urls?

Should it be something like this?
To get a single course:

courses/:course_id/ 

To get a course and it’s topics:

courses/:course_id/topics

To get a topic and it’s parts and it’s bullet points:

courses/:course_id/topics/:topic_id/parts

I am new to this and so am wondering how I should really be approaching the structure of the urls.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:51:23+00:00Added an answer on June 17, 2026 at 2:51 pm

    I think your suggested URL structure is good. It also corresponds nicely to a good resource layout.

    // courses
    $list = $model->getCourseList();
    
    // courses/c_id
    $course = $model->getCourse($c_id);
    
        // courses/c_id/topics
        $courseTopicList = $course->getTopicList();
    
        // courses/c_id/topics/t_id
        $courseTopic = $course->getTopic($t_id);
    
            // courses/c_id/topics/t_id/parts
            $courseTopicParts = $topic->getParts();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a webapp for iPad and i got stuck on something that should
I've stuck with this SQLAlchemy-Python problem: here's a class that should do simple update
I'm stuck on what I think should be a minor problem, but I couldn't
I am stuck with that task. I've written svn post-commit hook, that should update
I am stuck with a problem. I am having tool part where I get
I am stuck on how should I cope with the screen resolution problem ....
I'm stuck in something that looks like it should be simple to SED. I
I'm a bit stuck with a problem. I feel like the solution should be
Got stuck and need some help, This should be relatively simple but it's been
I am doing something that should be simple and getting stuck over and over

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.