Pagination links not including type of activity - sony-lifelog-api

When making a call including the "type" parameter, only the first page actually seems to be affected. The link to the next page does not include the parameter, and thus the following pages are unaffected.
Is this an error in the API, or are developers supposed to include this themselves?

So you should be able to take that exact "href" url in the return json and use that to get the next set of data.
"links": [
{
"rel": "next",
"href": " -- copy this link --"
I know that it does not include the type, but if you look at the dates and the data returned it should be the next data set.
I would recommend testing this out in the online API explorer just to verify that it works:
https://developer.sony.com/develop/services/lifelog-api/api-explorer/
With this query:
https://platform.lifelog.sonymobile.com/v1/users/me/activities?type=physical

Related

How the body of the PATCH request should look like to change values in an array?

I need to change the values of the object on a third-party resource. I authorize there by token. Passing data via JSON
There is an object, for example, with this structure:
{"Fields": {"anyid": {"Blocks": []}},
"name": "123"}
I want to insert a value into this object, in the "Blocks" array: [], insert a value, for example "anyword".
Write PATCH request
{"Fields": {"anyid": {"Blocks": ["anyword"]}}}
and i get an error - 500 "Object reference not set to an instance of an object"
but, if i will write
{"Name": "any name"},
the query works absolutely correctly and the value changes.
The problem is directly with the nested fields within Fields, can you tell me how the body of the request should look so that I can change the values in the array?

Possible to pass parameters via Looker Studio Linking API?

Question for anyone using the Looker Studio Linking API: Can I pass a parameter value via the Linking API URL so it gets used in the created copy of the report?
The Linking API has its own parameter types that can be included in the URL in order to accomplish various things (URL parameters, Control parameters, Report parameters) but I'm talking about finding a way to set the value of a parameter that is part of a report's embedded data source.
Yes, you can pass parameter values in the URL.
There is no description of this in the Linking API documentation, which seems to be an oversight since it is possible. A description of how can be found in the Overridable config parameters section of the Developer's Guide for Community Connectors.
In summary, you need to:
Switch the report to Edit mode
Go to "Resource" -> "Manage report URL parameters" in the menu and check the "Allow to be modified in report URL" check box for the parameter you want to pass. Also take note of the parameter name, in the example it's ds0.zipcode
Create a JSON string with the parameter name and value:
{
"ds0.zipcode": "94094"
}
URL-encode the JSON string you created:
%7B%22ds0.zipcode%22%3A%2294094%22%7D
Add a query parameter named params to the report URL with the above URL-encoded JSON as the value:
https://lookerstudio.google.com/reporting/REPORT_ID/page/PAGE_ID?params=%7B%22ds0.zipcode%22%3A%2294094%22%7D
(Replace REPORT_ID and PAGE_ID with the values for your report)
Note that there is a limitation when using the same parameter for multiple data sources in a report. The parameter will show up with a different name for each data source in the "Manage report URL parameters" page, and you will need to add the same value for each one in the URL (see this issue in Google's bug tracker)

How to fix Zapier not showing all Dynamic Dropdown options that are presented in a JSON Array GET API Repsonse?

I'm building a Zapier app for a platform that has dynamic fields that are specific to the individual user.
My API returns this response using a GET request:
[
{
"title": "003 Best Selling Book",
"id": "d86cbdf41be958336f1221a2211c3f65",
"date": "03/25/2021"
},
{
"id": "b844eaa3da5c476ab7337e83775777e0",
"title": "002 Best Selling Book",
"date": "03/26/2021"
}
]
The response is received by Zapier successfully
Response received by Zapier
but it is only showing the first item in the JSON array.
Only one object in my array shown.
When I go to test my trigger, it only shows me the one object in my array and give me a MISSING VALUE! error.
Missing Value Error in Zapier
Does anyone know how to fix this?
I'm trying to setup a Dropdown Type that is Dynamic and uses a Trigger to get the JSON object that populates the trigger.
A screenshot of the settings for the my dropdown from the Form Editor on the Zapier Platform Input Designer
I tried looking for example code in the Zapier Github or elsewhere on Stackoverflow or the web that showed example JSON responses for Zapier Actions, Zapier Triggers and Zapier Dynamic Dropdowns but couldn't find any.
Per the docs, your returned JSON needs name and id properties.

How to create JSON object dynamically in Azure Logic Apps?

I have a workflow in Azure Logic App that execute an API call to get custom fields values from Trello card. Then, I put a 'for each' step to get the definition (field name) of every custom field. This is made by calling another method of Trello API. I want to create a JSON object based in the values I've got from these API calls. The format of JSON is as simple as:
{
"name1": "value1",
"name2": "value2",
...
}
Edit:
I have an initial object with this schema:
{
"Cel": "",
"City": "",
"CreatedOn": "",
"Lead": "",
"Mail": "",
"Brand": "",
"Name": "",
"Salesperson": ""
}
It's a simple json object with key:value pairs.
I want to set the object properties inside a for each loop. I got the values of the fields from Trello API (returns an array like):
[{"id":"5fbdb5da1626b7499d690ebf","value":{"date":"2020-11-09T15:00:00.000Z"},"idCustomField":"5fbdb5cee93a775e4a9405e5","idModel":"5fa53d647b35d5744fd8b856","modelType":"card"},{"id":"5fa946e31680220774095ed9","idValue":"5fa9464bd260145aacba03ed","idCustomField":"5fa9462327f2c331a184a483","idModel":"5fa53d647b35d5744fd8b856","modelType":"card"},{"id":"5fa946e0dafc5b7ead25411a","value":{"text":"Lilia Noemi Cabral"},"idCustomField":"5fa9454303ee497b7b99772a","idModel":"5fa53d647b35d5744fd8b856","modelType":"card"},{"id":"5fa946bf8697d18d58b73ac1","value":{"text":"Tania"},"idCustomField":"5fa94518f410418c57662fd0","idModel":"5fa53d647b35d5744fd8b856","modelType":"card"},{"id":"5fa946c3a2ee2771d26ba30e","value":{"text":"tania#gmail.com"},"idCustomField":"5fa945088fc819708d157c5b","idModel":"5fa53d647b35d5744fd8b856","modelType":"card"},{"id":"5fa946bc38b469081857ea9a","value":{"text":"Asuncion"},"idCustomField":"5fa944fe9d7af62b3806c8b6","idModel":"5fa53d647b35d5744fd8b856","modelType":"card"},{"id":"5fa946b82bbaf938c4c3c341","value":{"number":"098234567"},"idCustomField":"5fa944e59527342399f460e2","idModel":"5fa53d647b35d5744fd8b856","modelType":"card"},{"id":"5fa946b32aad4d323ba0648e","value":{"text":"Tania Cardozo Olivera"},"idCustomField":"5fa944d779089c6ca5cf534b","idModel":"5fa53d647b35d5744fd8b856","modelType":"card"}]
I put a for each step to iterate and parse the field value. I got the field name with another call to Trello API, which return this response:
{"id":"5fa94518f410418c57662fd0","idModel":"5f988b8cb225cc7ac34deae9","modelType":"board","fieldGroup":"53eb88d2e4cde013cb9f03e7500ad1a00a4c82f153f9165f7b1ec554f4cc2d74","display":{"cardFront":true},"name":"Name","pos":81920,"type":"text","limits":{"customFieldOptions":{"perField":{"status":"ok","disableAt":50,"warnAt":45}}},"isSuggestedField":false}
So, I matched the idCustomField to get the field name and field value. Now I want to set the property in the initial declared object (each property name is equal to custom field name in Trello)
I've tried using a compose step with:
setProperty(variables('Object'),body('Parse_JSON')?['name'],body('Parse_JSON2')?['text'])
And later set the variable object to the compose outputs, but doesn't work fine. The result object doesn't have all the properties set. My idea is to set all the object properties inside the for each loop.
What could I be doing wrong?
Is there a way to achieve that in Azure Logic Apps?
Thanks in advance!
You should use
setProperty(variables('object'), body('Parse_JSON')?['name'], body('Parse_JSON_2')?['value']?['text'])
instead of
setProperty(variables('Object'),body('Parse_JSON')?['name'],body('Parse_JSON2')?['text'])
================================Update===================================
Your problem may be caused by the "For each" loop run in parallel, so please try with the steps below (Note: if you do this change, when you want to change back, sometimes it will show error message when you click "Save" of you logic app. So please create another logic app for test or make a backup copy of logic app):
Click the "Settings" of your "For each" loop.
Then enable Concurrency Control and set Degree of Parallelism as 1.

Customising the JSON generated by EXT-JS

I am using EXT-JS 3.2.0 and I have an Ext.grid.EditorGridPanel backed by a Ext.data.Store object. The store has the restful flag on and uses Ext.data.JsonReader and Ext.data.JsonWriter. It works great for retrieving data and populating the grid. However, when I add or update a record, the JSON produced for the POST/PUT has the data nested under a root field. This is not matching up with what the service I am calling expects. It wants a flat object. For example, when I add or update a record, the JSON produces looks something like this:
{
"data": {
"name": "TEST",
"id": "-1"
}
}
But I need it to be
{
"name": "TEST",
"id": "-1"
}
Any ideas?
Thanks,
John
I don't know if it's the best approach but I ended up creating my own Ext.data.Connection object and making the request where I needed it, for example on the delete. Not the solution I was hoping for but it works.

Resources