Issue adding a request via API with Python

Issue adding a request via API with Python

Hello,

      I am trying to add a request in ManageEngine (cloud version) via API using Python. The error I get is below:

{'response_status': {'messages': [{'status_code': 4001, 'field': 'input_data', 'type': 'failed', 'message': 'Value not present for input_data'}], 'status': 'failed'}}

The python code I am using is below:

import requests
import json

URL = 'https://sdpondemand.manageengine.com/app/<my_portal_name>/api/v3/requests'
headers = {
    'Accept': 'application/vnd.manageengine.sdp.v3+json',
    'Authorization': '<my_authorization_code>'
}
payload = {

  "input_data": {
    "request": {
      "subject": "Test ticket via API through Microsoft PowerAutomate",
      "description": "This is where the ticket description goes",
      "requester": {
        "id": "12345",
        "name": "<requestor_name>"
      },
      "impact_details": "Trying to add tickets via API",
      "resolution": {
        "content": "I keep getting errors"
      },
      "status": {
        "name": "Open"
      }
    }
  }

}

r = requests.post(url = URL,  headers= headers, json= payload )
j = r.json()
print(j)

Thank you!

                New to ADSelfService Plus?