All URIs are relative to https://<sub_domain>.api.kandji.io
Method | HTTP request | Description |
---|---|---|
CreateTag | Post /api/v1/tags | Create Tag |
DeleteTag | Delete /api/v1/tags/{tag_id} | Delete Tag |
GetTags | Get /api/v1/tags | Get Tags |
UpdateTag | Patch /api/v1/tags/{tag_id} | Update Tag |
TagsCreateTag201Response CreateTag(ctx).Body(body).Execute()
Create Tag
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/MScottBlake/kandji-go-sdk"
)
func main() {
body := "{"name":"accuhive_01"}" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TagsAPI.CreateTag(context.Background()).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.CreateTag``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateTag`: TagsCreateTag201Response
fmt.Fprintf(os.Stdout, "Response from `TagsAPI.CreateTag`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateTagRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
body | string |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteTag(ctx, tagId).Execute()
Delete Tag
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/MScottBlake/kandji-go-sdk"
)
func main() {
tagId := "tagId_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.TagsAPI.DeleteTag(context.Background(), tagId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.DeleteTag``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
tagId | string |
Other parameters are passed through a pointer to a apiDeleteTagRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AutomatedDeviceEnrollmentIntegrationsListAdeDevices200Response GetTags(ctx).Search(search).Execute()
Get Tags
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/MScottBlake/kandji-go-sdk"
)
func main() {
search := "accuhive" // string | Return resultes containing a given tag search string.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TagsAPI.GetTags(context.Background()).Search(search).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.GetTags``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTags`: AutomatedDeviceEnrollmentIntegrationsListAdeDevices200Response
fmt.Fprintf(os.Stdout, "Response from `TagsAPI.GetTags`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiGetTagsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
search | string | Return resultes containing a given tag search string. |
AutomatedDeviceEnrollmentIntegrationsListAdeDevices200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TagsCreateTag201Response UpdateTag(ctx, tagId).Body(body).Execute()
Update Tag
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/MScottBlake/kandji-go-sdk"
)
func main() {
tagId := "tagId_example" // string |
body := "{"name":"accuhive_02"}" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.TagsAPI.UpdateTag(context.Background(), tagId).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TagsAPI.UpdateTag``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateTag`: TagsCreateTag201Response
fmt.Fprintf(os.Stdout, "Response from `TagsAPI.UpdateTag`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
tagId | string |
Other parameters are passed through a pointer to a apiUpdateTagRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
body | string | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]