All URIs are relative to https://api.rankvectors.com
| Method | HTTP request | Description |
|---|---|---|
| CreateApiKey | Post /api/api-keys | Create API key |
| DeleteApiKey | Delete /api/api-keys/{id} | Delete API key |
| ListApiKeys | Get /api/api-keys | List API keys |
| UpdateApiKey | Patch /api/api-keys/{id} | Update API key |
ApiKeyResponse CreateApiKey(ctx).CreateApiKeyRequest(createApiKeyRequest).Execute()
Create API key
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/rankvectors/rankvectors-go-sdk"
)
func main() {
createApiKeyRequest := *openapiclient.NewCreateApiKeyRequest("WordPress Plugin") // CreateApiKeyRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.APIKeysAPI.CreateApiKey(context.Background()).CreateApiKeyRequest(createApiKeyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `APIKeysAPI.CreateApiKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateApiKey`: ApiKeyResponse
fmt.Fprintf(os.Stdout, "Response from `APIKeysAPI.CreateApiKey`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateApiKeyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| createApiKeyRequest | CreateApiKeyRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteSuggestion200Response DeleteApiKey(ctx, id).Execute()
Delete API key
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/rankvectors/rankvectors-go-sdk"
)
func main() {
id := "id_example" // string | API key ID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.APIKeysAPI.DeleteApiKey(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `APIKeysAPI.DeleteApiKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteApiKey`: DeleteSuggestion200Response
fmt.Fprintf(os.Stdout, "Response from `APIKeysAPI.DeleteApiKey`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string | API key ID |
Other parameters are passed through a pointer to a apiDeleteApiKeyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ApiKey ListApiKeys(ctx).Execute()
List API keys
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/rankvectors/rankvectors-go-sdk"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.APIKeysAPI.ListApiKeys(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `APIKeysAPI.ListApiKeys``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListApiKeys`: []ApiKey
fmt.Fprintf(os.Stdout, "Response from `APIKeysAPI.ListApiKeys`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiListApiKeysRequest 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]
ApiKey UpdateApiKey(ctx, id).UpdateApiKeyRequest(updateApiKeyRequest).Execute()
Update API key
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/rankvectors/rankvectors-go-sdk"
)
func main() {
id := "id_example" // string | API key ID
updateApiKeyRequest := *openapiclient.NewUpdateApiKeyRequest() // UpdateApiKeyRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.APIKeysAPI.UpdateApiKey(context.Background(), id).UpdateApiKeyRequest(updateApiKeyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `APIKeysAPI.UpdateApiKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateApiKey`: ApiKey
fmt.Fprintf(os.Stdout, "Response from `APIKeysAPI.UpdateApiKey`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| id | string | API key ID |
Other parameters are passed through a pointer to a apiUpdateApiKeyRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
updateApiKeyRequest | UpdateApiKeyRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]