Required request body is missing

Hi All,

I was trying to create an account via access request. However, I am encountering this error even though the HTTP body is populated. I was also able to successfully call the API in postman.

Create Account body:

{
    "user": {
        "name": "$plan.name$",
        "siteRole": "$plan.siteRole$"
    }
}

I tried to hardcode the values for name and siteRole and it is working fine when I tried to request an access. I am not sure why the error log is saying “Required request body is missing” when I try to use the attributes from my Create Account provisioning plan.

Hello @jasmedina,

Can you please share the details of your operation configuration on the request and your create account plan?

Thanks,
Braden

Hi @bcariaga! Here is the Create Account plan:

Create Account body:

{
    "user": {
        "name": "$plan.name$",
        "siteRole": "$plan.siteRole$"
    }
}

Headers

Response Mapping:

Curl from Postman:

curl --location 'https://xxxx \
--header 'Content-Type: application/json' \
--header 'X-Tableau-Auth: xxxxxx' \
--data '{
    "user": {
        "name": "testuser",
        "siteRole": "Viewer"
    }
}'
1 Like

it looks ok

if not working, then see what you can find in CCG log.

You may need to create and attach a Web Service Before Operation rule to the create HTTP Operation, so you can see exactly the headers and body of the request you are sending.

Hi @jasmedina ,

If your using tableau application refer below link:
Users and Groups Methods - Tableau

Change API body to xml format like below:

<tsRequest>
  <user name="$plan.name$"
        siteRole="$plan.siteRole$"
</tsRequest>

Thank You.

Hi @jasmedina , can you check if you are getting attribute values as expected in plan, you can check this in ccg.log in VA.

you can patch the before operation rule to operation and check.

Please modify below snippet as per the requirement and use

import java.util.List; 
import java.util.HashMap; 
import java.util.Map; 
import sailpoint.tools.Util; 
import sailpoint.object.ProvisioningPlan;
import sailpoint.object.ProvisioningPlan.AccountRequest;
import sailpoint.object.ProvisioningPlan.AttributeRequest;
import sailpoint.object.ProvisioningPlan.GenericRequest;
import connector.common.JsonUtil; 

Map body = requestEndPoint.getBody();
String jsonBody = (String) body.get("jsonBody");
Map jsonMap = JsonUtil.toMap(jsonBody);
log.info("-----JsonBody"+ jsonMap);
 if (provisioningPlan != null) {
        List accounts = provisioningPlan.getAccountRequests();
    for (AccountRequest accReq : Util.iterate(provisioningPlan.getAccountRequests())) {

        for (ProvisioningPlan.AttributeRequest attReq : Util.iterate(accReq.getAttributeRequests())) {
            if (attReq != null) {
              log.info("------Attribute Name From Plan : "+attReq.getName(), );
			  log.info("-------Attribute Value From Plan : "+ attReq.getValue());
              
            } 
        }
    }
 }


Hope this helps to troubleshoot

Thank you

4 Likes

Hi Jason,

Based from the CCG logs, the body is missing. Even though I can see that the body in the Create Account operation is configured.

Thank you, Rakesh! I will try this out :slight_smile:

Hi @rkhade! I am getting the correct attribute values as per the logs. However, when I look at the error message, it seems that it is not seeing or passing those attributes.

Logs for Attributes:
image

Error message:

“message”:“Updating account null result with error message {"error":{"summary":"Bad Request","detail":"Payload is either malformed or incomplete","code":"400000"}”

It looks like it this attribute is not getting passed in the body. I am not sure why it is happening since this is working correctly in postman.
image

Create Account body:

{
“user”: {
“name”: “$plan.name$”,
“siteRole”: “Viewer”
}
}

Tried also setting the name attribute as the account ID and used $plan.nativeIdentity$ in the body. Here’s the log below:

image\

The name attribute is now being passed in the body however, I am getting a different error:

{"error":{"summary":"Resource Not Found","detail":"User ‘jmedina’ could not be found.","code":"404002"}

Hi @jasmedina ,

As the id is not passed while creating account, it needs to be fetched from create account response body and pass to the next operations.

Can you check the response mapping of create account operation once, you can use JSON path finder for this, if its correct.

Try configuring get Object operation, Which will fetch the single the account details once the account is created, Use fetch single account API for configuration.

Thank you

1 Like

Hi @rkhade! The response mapping is correct and id is also in the response mapping:
image

I am not sure if get Object will work since the account is not created to begin with.

As the same body is working with hardcoded values, looks like the error is thrown by some other operation(Add Entitlement, update Account) after create operation, can you check those operations or remove those operation and test.

Based on the error code it looks like your Tableau is using AD for auth, and the format of the name is not valid. Can you validate once.

Also check this out

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.