Does the API supports custom fields?

I searched the forum but didn’t find anything related. Does the API support custom fields?

edit: Grammar

Yes. It does support custom fields. What have you tried to do so far?

I used below code in power query. I was able to only get these default columns { “key”, “image”, “attachment”, “edit”, “view”, “date”, “paidFrom”, “receivedIn”, “description”, “amount” }

let
    apiKey = "apikey here",
    options = [Headers=[accept="application/json", #"X-API-KEY"=apiKey]],
    response = Web.Contents("https://sth.manager.io/api2/payments?pageSize=1000&fields=", options),
    jsonResponse = Json.Document(response),
    #"Converted to Table" = Record.ToTable(jsonResponse),
    #"Filtered Rows" = Table.SelectRows(#"Converted to Table", each ([Name] = "payments")),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Name"}),
    #"Expanded Value" = Table.ExpandListColumn(#"Removed Columns", "Value"),
    #"Expanded Value1" = Table.ExpandRecordColumn(#"Expanded Value", "Value", {"key", "image", "attachment", "edit", "view", "date", "paidFrom", "receivedIn", "description", "amount"}, {"key", "image", "attachment", "edit", "view", "date", "paidFrom", "receivedIn", "description", "amount"}),
    #"Expanded amount" = Table.ExpandRecordColumn(#"Expanded Value1", "amount", {"value", "currency"}, {"value", "currency"}),
    #"Removed Columns1" = Table.RemoveColumns(#"Expanded amount",{"key", "image", "attachment", "edit", "view"}),
    #"Multiplied Column" = Table.TransformColumns(#"Removed Columns1", {{"value", each _ * -1, type number}}),
    #"Pivoted Column" = Table.Pivot(#"Multiplied Column", List.Distinct(#"Multiplied Column"[currency]), "currency", "value", List.Sum)
in
    #"Pivoted Column"

I also tried JavaScript as below:

Side note: I noticed that the business name does not change in the API and keeps showing the original name.

edit: edited the image.

Good here, 24.5.16.1536

image

You did not illustrate how it supports custom fields.

1 Like