Hey Guys Hoping to get some help on something im c...
# gd-beginners
a
Hey Guys Hoping to get some help on something im currently using the API to POST metrics into a work space is there a way to do it in bulk as when i try to bulk POST a metric it says it can take an array of values does it have to be done one by one
m
Hi Anthony, In GoodData Cloud, when you’re working with the API to POST metrics into a workspace, it is indeed possible to submit multiple metrics in a single request by providing them as an array. The following Doc should be able to help in creating your API call: https://www.gooddata.com/docs/cloud/create-metrics/create-metrics-using-api/
a
Thanks mate but for some reason i get this response when posing bulk values
j
Hi Anthony, Apologies, you are actually right. With this particular endpoint, it is not possible to send an array of multiple metrics because it does not allow it. However, you could use a declarative API instead and rewrite the whole workspace layout endpoint: https://www.gooddata.com/docs/cloud/create-workspaces/declarative-interface/#WorkspaceDeclarativeAPIInterface-WorkspaceDeclarativeLayoutDocument Here you can easily add multiple metrics into the JSON body. However, please be very careful while working with the whole workspace layout JSON and make sure that you are only amending the metrics (or whatever is actually needed).