cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API authentication error

gdp-d
Visitor

I am unable to use POST request using event ingest API

 

 curl --request POST \
    --url https://{environmentid}.apps.dynatrace.com/api/v2/events/ingest \
    --header 'Authorization: Api-Token dt0c01.XXXX.XXXXX' \
  --data '{
    "eventType": "MARKED_FOR_TERMINATION",
    "title": "Planned host downscale",
    "entitySelector": "type(HOST),fromRelationship.isInstanceOf(type(HOST_GROUP),entityName(cloud-burst-hosts))",
    "properties": {
        "job.number": "21234346"
    }
}'

 

2 REPLIES 2

Esam_Eid
Contributor

you need to make sure the token you use has the required scope: events.ingest 

AND

One of the following permissions is required for personal access tokens:

  • environment:roles:viewer
  • storage:events:write

Regards,

Yosi_Neuman
DynaMight Guru
DynaMight Guru

Hi @gdp-d 

Please try to replace the url string: 

--url https://{environmentid}.apps.dynatrace.com/api/v2/events/ingest \

with: 

--url https://{environmentid}.live.dynatrace.com/api/v2/events/ingest \

HTH

Yos 

dynatrace certificated professional - dynatrace master partner - Matrix Soft Ware Division - Israel

Featured Posts