Forums
Payload not return opportunities from my Maximizer to Power BI, can someone please assist. This is the error I am getting : This functionality is currently of BETA/CTP quality (not ready for production usage)
last year by Thabang
Here is my Payload
let
// Define the URL for the API endpoint with Basic Authentication
url = "https://crm.maxcloudcrm.com/MaximizerWebData/Data.svc/json/OpportunityRead",
// Define the JSON payload for the request
jsonPayload = [
configuration = [
drivers = [
IOpportunitySearcher = "Maximizer.Model.Access.Sql.OpportunitySearcher"
]
],
opportunity = [
criteria = [
searchQuery = {},
top = 10
],
scope = [
fields = [
Key = 1,
AbEntryKey = 1,
AbEntry = 1,
ContactKey = 1,
Contact = 1,
Objective = 1,
Description = 1,
Status = 1,
Cost = 1,
ActualRevenue = 1,
ForecastRevenue = 1,
StartDate = 1,
CloseDate = 1,
Creator = 1,
CreationDate = 1,
ModifiedBy = 1,
LastModifyDate = 1,
Leader = 1,
SalesTeam = 1,
NextAction = 1,
SalesProcessSetupKey = 1,
SalesProcessSetup = 1,
SalesStageSetupKey = 1,
SalesStageSetup = 1,
SalesProcessKey = 1,
SalesProcess = 1,
CurrentSalesStageKey = 1,
CurrentSalesStage = 1,
CurrentSalesStageAge = 1,
PartnerKeys = 1,
PartnerInfo = 1,
CompetitorInfo = 1,
Comment = 1,
Reason = 1,
DisplayValue = 1,
Age = 1,
CampaignKey = 1,
Campaign = 1,
Category = 1,
Product = 1,
Rating = 1
]
]
]
],
// Convert JSON payload to binary for HTTP request
binaryPayload = Json.FromValue(jsonPayload),
// Make the HTTP GET request using Web.Contents with Basic Authentication
Source = Json.Document(
Web.Contents(
url,
[
Headers = [
Authorization = "Bearer xxxxxxxxxxxx",
#"Content-Type" = "application/json" // Optional: Specify content type if needed
],
Content = binaryPayload // Pass JSON payload directly
]
)
),
// Access the 'Msg' field from the response
Msg = Source[Msg],
// Access the 'Msg' field from the response
Msg1 = Msg{0}
in
Msg1
