(Incidents.Notes)
Create Notes
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"github.com/SquadcastHub/squadcast-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Incidents.Notes.Create(ctx, "<id>", components.V3IncidentsNotesCreateNoteRequest{
Message: "<value>",
Attachments: []string{
"<value 1>",
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
incidentID |
string | ✔️ | Required |
v3IncidentsNotesCreateNoteRequest |
components.V3IncidentsNotesCreateNoteRequest | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.NotesCreateNotesResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
delete note from incidentId mentioned in params.
Requires access_token as a Bearer {{token}} in the Authorization header with service-write scope.
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Incidents.Notes.Delete(ctx, "<id>", "<id>")
if err != nil {
log.Fatal(err)
}
if res.Body != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
incidentID |
string | ✔️ | Required |
noteID |
string | ✔️ | Required |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.NotesDeleteNoteResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |
This API can be used to update a Note or a Resolution reason associated with an incident
package main
import(
"context"
"os"
squadcastsdk "github.com/SquadcastHub/squadcast-sdk-go"
"github.com/SquadcastHub/squadcast-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := squadcastsdk.New(
squadcastsdk.WithSecurity(os.Getenv("SQUADCASTSDK_BEARER_AUTH")),
)
res, err := s.Incidents.Notes.Update(ctx, "<id>", "<id>", components.V3IncidentsNotesUpdateNoteRequest{
Message: "<value>",
Attachments: []string{},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
incidentID |
string | ✔️ | Required |
noteID |
string | ✔️ | N/A |
v3IncidentsNotesUpdateNoteRequest |
components.V3IncidentsNotesUpdateNoteRequest | ✔️ | N/A |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.NotesUpdateNoteResponse, error
| Error Type | Status Code | Content Type |
|---|---|---|
| apierrors.BadRequestError | 400 | application/json |
| apierrors.UnauthorizedError | 401 | application/json |
| apierrors.PaymentRequiredError | 402 | application/json |
| apierrors.ForbiddenError | 403 | application/json |
| apierrors.NotFoundError | 404 | application/json |
| apierrors.ConflictError | 409 | application/json |
| apierrors.UnprocessableEntityError | 422 | application/json |
| apierrors.InternalServerError | 500 | application/json |
| apierrors.BadGatewayError | 502 | application/json |
| apierrors.ServiceUnavailableError | 503 | application/json |
| apierrors.GatewayTimeoutError | 504 | application/json |
| apierrors.APIError | 4XX, 5XX | */* |