SpaceTradersAPI / api-docs

The API documentation for the SpaceTraders API
143 stars 35 forks source link

API requires faction to create an agent, but factions api endpoint is gated by auth #29

Closed SReject closed 1 year ago

SReject commented 1 year ago

To create an agent/account the request body requires an initial faction to be specified but the API endpoint to list factions is gated by auth.

space-admiral commented 1 year ago

Thanks for the great feedback, I think we'll add the factions to the docs while we figure out how to handle endpoints that maybe shouldn't require a token.

MichaelGoulding commented 1 year ago

I was able to see the factions by going to https://api.spacetraders.io/v2/factions

pennyarcade commented 1 year ago

This may be a documentation issue. If the endpoint is documented with a playerFaction ENUM it is clear witch values are allowed. The game documentation then should have basic player faction stats/description.

Edit: This is already documented...

                                        "description": "The faction you choose determines your headquarters.",
                                        "enum": [
                                            "COSMIC",
                                            "VOID",
                                            "GALACTIC",
                                            "QUANTUM",
                                            "DOMINION"
                                        ]
                                    },
tyrope commented 1 year ago

Given that /factions is available without auth, and now has an isRecruiting field. I propose that we should change that enum to a string, and send an appropriate error based on the string given: 404 Not Found for a faction not found and 403 Forbidden for a faction that's not recruiting?

issue title could also use an update, at this point. (As we've established the factions endpoint does not require auth)

SReject commented 1 year ago

This has been resolved with factions endpoint no longer being gated