How to get the source code for xblock API for creating course structures(sections/subsections etc)

Hi. My tutor version is - 15.0.0 (official aws image)
I was checking while creating a section/subsections etc this API - {host}/xblock/ gets called(POST). I need to customize this API(not sure it’s a REST api or django API though). I searched for the endpoint, but I couldn’t find one in the openedx repo(the GET endpoints I know). I even checked here also - GitHub - openedx/XBlock: Framework for building custom learning components that run in the Open edX LMS!. But could not find the endpoint and the source code. Could anyone pls help me with this

Requirement - Trying to create course structures using REST apis

Hi,
I take it that you are on the olive release of openedx.
First of all, you can see the (auto-generated) swagger doc for the endpoints by going to {studio-url-base}/api-docs/ . The endpoint is right at the bottom, under “xblock”. From this you can see it is indeed a REST endpoint. We are using this endpoint for our MFEs.

It’s not a public API, though in the future we are experimentally adding a new public endpoint for this (not included in palm release, and as I said experimentally). Basically it requires a user to be logged in with a cookie.

So the code for this can be found under cms/djangoapps/contentstore/views/block.py , and the method responsible for all calls to /xblock/ is xblock_handler.

We just worked on this, so I can give you a lot more info if you require. In case your goal on your fork is to make this endpoint public via oauth on your end - for using it not with a frontend, but someone making API requests to automate creating course contents - be advised that this is something that we are actively working on and have done a lot of discovery and first experimental features for, so I can provide more info for you.

Feel free to reach out to me in the openedx slack.