Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi everyone,
I'm trying to get data from hubspot API to powerbi using a POST method. I'm using this code to get the data but for some reason i'm receiving this error:
We cannot convert the value "[Binary]" to type Text
Details:
Value=[Binary]
Type=[Type]
let
data = "{'properties': [
'hs_survey_type'
],
'filterGroups':[{
'filters':[
{
'propertyName':'hs_createdate',
'operator':'BETWEEN',
'highValue': '1705552000000',
'value':'1704064000000'
},
{
'propertyName':'hs_survey_type',
'operator':'EQ',
'value':'CSAT'
}
]
}
]
}",
baseuri = "https://api.hubapi.com/crm/v3/objects/feedback_submissions/search",
initReq = Json.Document(Web.Contents(baseuri, [Headers = [Authorization="Bearer HERE_THE_TOKEN", #"Content-Type"="application/json", Content= Json.FromValue(data)]])),
initData = initReq[results]
in
initData
What might i am doing wrong?
Solved! Go to Solution.
Thanks everyone, I solved it by myself. Here you can check the final solution:
let
data = "{""properties"":[""hs_survey_type""],""filterGroups"":[{""filters"":[{""propertyName"":""hs_createdate"",""operator"":""BETWEEN"",""highValue"":""1705552000000"",""value"":""1704064000000""},{""propertyName"":""hs_survey_type"",""operator"":""EQ"",""value"":""CSAT""}]}]}",
baseuri = "https://api.hubapi.com/crm/v3/objects/feedback_submissions/search",
initReq = Json.Document(Web.Contents(baseuri, [
Headers = [
Authorization="Bearer HERE_THE_TOKEN",
#"Content-Type"="application/json"
],
Content=Text.ToBinary(data)
])),
initData = initReq[results]
in
initData
First I moved 'Content' into web.contents parameters, and also I reformated 'data' from a text o a binary using Text.ToBinary
Thanks everyone, I solved it by myself. Here you can check the final solution:
let
data = "{""properties"":[""hs_survey_type""],""filterGroups"":[{""filters"":[{""propertyName"":""hs_createdate"",""operator"":""BETWEEN"",""highValue"":""1705552000000"",""value"":""1704064000000""},{""propertyName"":""hs_survey_type"",""operator"":""EQ"",""value"":""CSAT""}]}]}",
baseuri = "https://api.hubapi.com/crm/v3/objects/feedback_submissions/search",
initReq = Json.Document(Web.Contents(baseuri, [
Headers = [
Authorization="Bearer HERE_THE_TOKEN",
#"Content-Type"="application/json"
],
Content=Text.ToBinary(data)
])),
initData = initReq[results]
in
initData
First I moved 'Content' into web.contents parameters, and also I reformated 'data' from a text o a binary using Text.ToBinary
Hello @jumercor,
Can you please try this:
let
data = "{'properties': [
'hs_survey_type'
],
'filterGroups':[{
'filters':[
{
'propertyName':'hs_createdate',
'operator':'BETWEEN',
'highValue': '1705552000000',
'value':'1704064000000'
},
{
'propertyName':'hs_survey_type',
'operator':'EQ',
'value':'CSAT'
}
]
}
]}",
baseuri = "https://api.hubapi.com/crm/v3/objects/feedback_submissions/search",
content = Json.FromValue(Text.FromBinary(data)),
headers = [
Authorization="Bearer HERE_THE_TOKEN",
#"Content-Type"="application/json"
],
response = Web.Contents(baseuri, [
Content=content,
Headers=headers,
Method="POST"
]),
responseText = Text.FromBinary(response),
initReq = Json.Document(responseText),
initData = initReq[results]
in
initData
Thanks, but I'm receiving -> Expression.Error: "Method" is not a valid option for Web.Contents. Valid options:
ApiKeyName, Content, ExcludedFromCacheKey, Headers, IsRetry, ManualStatusHandling, Query, RelativePath, Timeout
You don't need to specify Method. It is sufficient to provide a content payload, that will switch We.Contents from GET to POST automatically.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 17 | |
| 9 | |
| 8 | |
| 7 |