All URIs are relative to https://api.spacetraders.io/v2
Method | HTTP request | Description |
---|---|---|
GetStatus | Get / | Get Status |
Register | Post /register | Register New Agent |
GetStatus200Response GetStatus(ctx).Execute()
Get Status
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/UnseenBook/spacetraders-go-sdk"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultAPI.GetStatus(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.GetStatus``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetStatus`: GetStatus200Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.GetStatus`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetStatusRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Register201Response Register(ctx).RegisterRequest(registerRequest).Execute()
Register New Agent
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/UnseenBook/spacetraders-go-sdk"
)
func main() {
registerRequest := *openapiclient.NewRegisterRequest(openapiclient.FactionSymbol("COSMIC"), "BADGER") // RegisterRequest | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DefaultAPI.Register(context.Background()).RegisterRequest(registerRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.Register``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `Register`: Register201Response
fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.Register`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiRegisterRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
registerRequest | RegisterRequest |
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]