Required field \"request body\" was missing or empty

I am using the /beta/connector-rules API and have been receiving the following error while trying to modify or create existing JDBCProvision Rules:

{
“detailCode”: “400.1.0 Required data missing or empty”,
“trackingId”: “0a1841621762431180863579ab25cd80”,
“messages”: [
{
“locale”: “en-US”,
“localeOrigin”: “DEFAULT”,
“text”: “Required field "request body" was missing or empty.”
}
],
“causes”: [ ]
}

I have taken the GET response, pasted it in the body, removed created and modified data, and get this error. Any thoughts?

Hello @justinrhaines,

From the screenshot everything looks correct and in order.

Can you share with me the following information?

  • The variable for {{api-url}}
  • The raw json of your post body
  • The headers that you are providing

Hi @tyler_mairose

 {
        "description": "This rule is used for JDBC Provisioning of CWR PeopleHub",
        "type": "JDBCProvision",
        "signature": {
            "input": [],
            "output": null
        },
        "sourceCode": {
            "version": "1.0",
            "script": "import java.sql.Connection;\r\n import java.sql.DriverManager;\r\n import java.sql.PreparedStatement;\r\n import java.sql.Statement;\r\n import java.sql.SQLException;\r\n import java.sql.ResultSet;\r\n import java.sql.Types;\r\n import java.util.List;\r\n import sailpoint.api.SailPointContext;\r\n import sailpoint.connector.JDBCConnector;\r\n import sailpoint.object.Application;\r\n import sailpoint.object.ProvisioningPlan;\r\n import sailpoint.object.ProvisioningPlan.AccountRequest;\r\n import sailpoint.object.ProvisioningPlan.AttributeRequest;\r\n import sailpoint.object.ProvisioningPlan.PermissionRequest;\r\n import sailpoint.object.ProvisioningResult;\r\n import sailpoint.object.Schema;\r\n \r\n public String getAttributeRequestValue(AccountRequest acctReq, String attribute) \r\n {\r\n\r\n if ( acctReq != null ) \r\n\t{\r\n AttributeRequest attrReq = acctReq.getAttributeRequest(attribute);\r\n if ( attrReq != null )\r\n\t {\r\n return attrReq.getValue();\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n ProvisioningResult result = new ProvisioningResult();\r\n PreparedStatement statement;\r\n\r\n if ( plan != null ) \r\n {\r\n\r\n List accounts = plan.getAccountRequests();\r\n if ( ( accounts != null ) && ( accounts.size() > 0 ) ) \r\n\t{\r\n for ( AccountRequest account : accounts ) \r\n\t {\r\n try \r\n\t\t{\r\n if ( AccountRequest.Operation.Create.equals(account.getOperation() ) ) \r\n\t\t {\r\n // Ideally we should first check to see if the account already exists.\r\n // As written, this just assumes it does not.\r\n\r\n statement = connection.prepareStatement( \"insert into cwrpeoplehub ([First Name],[Last Name],[Account Name],[Group]) values (?,?,?,?)\" );\r\n \r\n statement.setString ( 1, getAttributeRequestValue(account,\"First Name\") );\r\n statement.setString ( 2, getAttributeRequestValue(account,\"Last Name\") );\r\n statement.setString ( 3,  account.getNativeIdentity());\r\n statement.setString ( 4, getAttributeRequestValue(account,\"Group\") );\r\n statement.executeUpdate();\r\n\r\n result.setStatus( ProvisioningResult.STATUS_COMMITTED );\r\n\r\n } \r\n } \r\n catch( SQLException e ) \r\n\t\t{\r\n result.setStatus( ProvisioningResult.STATUS_FAILED );\r\n result.addError( e );\r\n }\r\n finally \r\n\t\t{\r\n if(statement != null) {\r\n statement.close();\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n return result;"
        },
        "attributes": {
            "sourceVersion": "1.0"
        },
        "id": "6a8a14f063e14e659cd4463cb69cca4c",
        "name": "CWR-PeopleHub"
    }
  • Header: Content-Type: application/json

@justinrhaines,

Can you post your post body as a code block? I want to make sure I have exactly what you are using.

For example:

``` json
{
“key”: “value”
}
```

Will produce:

{
"key": "value"
}

I’m not sure how to paste as a code-block so I will upload the rule. Thanks!
CWR-PeopleHub.txt (2.8 KB)

Hello @justinrhaines,

I am able to use your post body in the creation of a connector rule in my tenant. This could be something related to your specific tenant. I would like you to submit a support ticket here with the details you shared with me and they can take a look at your specific logs to determine the root cause.

It appeared to be something with my Postman setup. Once I closed the request down and re-opened it, it functioned as requested. I don’t know what the issue was but thanks for looking into it.