PocketIC Server Api Documentation

Is there any internal documentation or hidden documentation for the PocketIC server api?
I would like to interface with it but the README says to look at the /api.json OpenAPI spec, but at least right now there are no return schemas. But even if there were it would be helpful to fully understand each route vs just a definition.
It seems like not all libraries implement each of the routes, so it would be nice to see what routes should be implemented and how to handle v2 routes and whatnot.
Any help would be great

Also routes like

/instances/{id}/api/v2/status:
    get:
      requestBody:
        content:
          application/octet-stream: {}
        required: true

dont seem to be properly documented with requests, since I dont think you can do a body with a get

The /api/v2 and /api/v3 routes are documented in the Internet Computer’s Interface Specification.

1 Like

I’d recommend to take the Rust library as a reference.

1 Like

If you saw the JS library, then it is behind the Rust version so not everything is implemented yet, but I intend to implement everything eventually. If you’re implementing a new library I think you should also aim to implement everything.

I’m not sure about the Python library though, @fxgst is it still maintained?

3 Likes

I have most routes implemented but im struggling with the http gateway functionality. I have been tracing it in the source code and it seems like the on creation of the gateway, it tries to fetch the root key using a /api/v2/status route but it seems to return a bad gateway
Is there anything i need to do specifically for the http gateway to be able to call that?

You may have to target an instance with the NNS (root) subnet so that /api/v2/status contains a root key.

1 Like

That worked. Thank you

@mraszyk @mraszyk
Follow up question

I’ve made a suggestion on the other thread.

Hi @NathanosDev, we’ve just updated PocketIC Python. It’s so back! :wink:

1 Like