Submit an abuse report
client.AbuseReports.New(ctx, reportParam, params) (*string, error)
POST/accounts/{account_id}/abuse-reports/{report_param}
Submit an abuse report of a particular type.
Requires the abuse-reports entitlement on the account (Enterprise
accounts have it by default; other accounts must request access) and an
API token with the Trust and Safety Write permission. If the account
is not entitled, the request is rejected with an HTTP 401 response
(see below).
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Accepted Permissions (at least one required)
Submit an abuse report
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/abuse_reports"
"github.com/cloudflare/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
abuseReport, err := client.AbuseReports.New(
context.TODO(),
"report_param",
abuse_reports.AbuseReportNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReport{
Act: cloudflare.F(abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReportActAbuseDmca),
Address1: cloudflare.F("x"),
AgentName: cloudflare.F("x"),
Agree: cloudflare.F(abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReportAgree1),
City: cloudflare.F("x"),
Country: cloudflare.F("x"),
Email: cloudflare.F("email"),
Email2: cloudflare.F("email2"),
HostNotification: cloudflare.F(abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReportHostNotificationSend),
Name: cloudflare.F("x"),
OriginalWork: cloudflare.F("x"),
OwnerNotification: cloudflare.F(abuse_reports.AbuseReportNewParamsBodyAbuseReportsDmcaReportOwnerNotificationSend),
Signature: cloudflare.F("signature"),
State: cloudflare.F("x"),
URLs: cloudflare.F("urls"),
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", abuseReport)
}
{
"abuse_rand": "abuse_rand",
"request": {
"act": "act"
},
"result": "result"
}Returns Examples
{
"abuse_rand": "abuse_rand",
"request": {
"act": "act"
},
"result": "result"
}