• Alex Chudovsky
  • NEWBIE
  • 10 Points
  • Member since 2016
  • WaveOC

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
I know about Salesforce Reports and Dashboards REST API. But Report REST API allows only to change (update) an existing report by sending PATCH request with appropriate json body and clone a report based on existing one by sending POST request. But I need to create a new Report, not cloned report.
Also I tested dashboard creation by sending POST request with appropriate json body on the url https://ap2.salesforce.com/services/data/v37.0/analytics/dashboards and it works. But the same doesn't work for the Report. After sending POST request on the url https://ap2.salesforce.com/services/data/v37.0/analytics/reports I got a response:
[ 
  { 
     "errorCode": "BAD_REQUEST",
     "message": "The clone request must contain a valid cloneId parameter." 
  }
]
It means that I cannot create new Report by sending POST request to the REST resource.
Also I tried to create report by upsert and insert methods of SOAP Partner API, but in the response result I got the next message:
<message>entity type cannot be updated: Report</message>
<statusCode>CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY</statusCode>
Have anybody ideas the way of report creation via Salesforce API?

I tried to save dashboard and report via Salesforce Reports and Dashboards REST API and it works, but when I change developerName in the request body and send this request, in the response I got a json body with saved metadata of Report/Dashboard and parameter developerName hasn't been changed.
I also used update and upsert methods of the Salesforce SOAP API, but in the response I got the next message:

<message>entity type cannot be updated: Report</message>
<statusCode>CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY</statusCode>
Have anybody any ideas how to change developerName of Dashboard and Report using Saleforce API?
The problem appears when I try to save a dashboard using PATCH method of Dashboards REST API. I do this by the same way as it said in the developer guide (https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/analytics_api_dashboard_save_dashboard.htm)
I tried different variants of PATCH request body, but in the response I got the same error:
{"errorCode":"JSON_PARSER_ERROR","message":"The request body is either invalid or incomplete."}

Request sends to https://ap2.salesforce.com/services/data/v36.0/analytics/dashboards/IdOfDasboard

Body of the request is:
{
	"dashboardMetadata": {
		"name": "TestDashboard"    
	}
}

Have anybody any ideas why it happens?

Thank you,
Alexei Chudovsky 
I know about Salesforce Reports and Dashboards REST API. But Report REST API allows only to change (update) an existing report by sending PATCH request with appropriate json body and clone a report based on existing one by sending POST request. But I need to create a new Report, not cloned report.
Also I tested dashboard creation by sending POST request with appropriate json body on the url https://ap2.salesforce.com/services/data/v37.0/analytics/dashboards and it works. But the same doesn't work for the Report. After sending POST request on the url https://ap2.salesforce.com/services/data/v37.0/analytics/reports I got a response:
[ 
  { 
     "errorCode": "BAD_REQUEST",
     "message": "The clone request must contain a valid cloneId parameter." 
  }
]
It means that I cannot create new Report by sending POST request to the REST resource.
Also I tried to create report by upsert and insert methods of SOAP Partner API, but in the response result I got the next message:
<message>entity type cannot be updated: Report</message>
<statusCode>CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY</statusCode>
Have anybody ideas the way of report creation via Salesforce API?
I know about Salesforce Reports and Dashboards REST API. But Report REST API allows only to change (update) an existing report by sending PATCH request with appropriate json body and clone a report based on existing one by sending POST request. But I need to create a new Report, not cloned report.
Also I tested dashboard creation by sending POST request with appropriate json body on the url https://ap2.salesforce.com/services/data/v37.0/analytics/dashboards and it works. But the same doesn't work for the Report. After sending POST request on the url https://ap2.salesforce.com/services/data/v37.0/analytics/reports I got a response:
[ 
  { 
     "errorCode": "BAD_REQUEST",
     "message": "The clone request must contain a valid cloneId parameter." 
  }
]
It means that I cannot create new Report by sending POST request to the REST resource.
Also I tried to create report by upsert and insert methods of SOAP Partner API, but in the response result I got the next message:
<message>entity type cannot be updated: Report</message>
<statusCode>CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY</statusCode>
Have anybody ideas the way of report creation via Salesforce API?

I tried to save dashboard and report via Salesforce Reports and Dashboards REST API and it works, but when I change developerName in the request body and send this request, in the response I got a json body with saved metadata of Report/Dashboard and parameter developerName hasn't been changed.
I also used update and upsert methods of the Salesforce SOAP API, but in the response I got the next message:

<message>entity type cannot be updated: Report</message>
<statusCode>CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY</statusCode>
Have anybody any ideas how to change developerName of Dashboard and Report using Saleforce API?
The problem appears when I try to save a dashboard using PATCH method of Dashboards REST API. I do this by the same way as it said in the developer guide (https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/analytics_api_dashboard_save_dashboard.htm)
I tried different variants of PATCH request body, but in the response I got the same error:
{"errorCode":"JSON_PARSER_ERROR","message":"The request body is either invalid or incomplete."}

Request sends to https://ap2.salesforce.com/services/data/v36.0/analytics/dashboards/IdOfDasboard

Body of the request is:
{
	"dashboardMetadata": {
		"name": "TestDashboard"    
	}
}

Have anybody any ideas why it happens?

Thank you,
Alexei Chudovsky