POST and combine for more features - clockify

I want to combine a POST-API Request. How I can do it? I use Postman.
Here is an exemple: I want to create Tag-Flags to make two new tags.
{"name": "test"}
{"name": "test2"}
problem

You can try it like this:
[{"name": "test"} , {"name": "test2"}]
https://www.json.org/json-en.html

Related

How to de-identify the data present in Big query table

How to de-identify the data already present in Big query table and then re-identify the same and load in other BQ table.
Thanks
The easiest way to do this is using dataflow pipeline call deidentifyContent.
I have created an example by using "de-identifying sensitive data" to de-identify the data with the following transformations which belongs to Data Loss Prevention (DLP) API and then insert them into BigQuery, however to re-identify the data is needed cryptographical tokens. To achieve this, you can use the supported cryptographic methods in Cloud DLP:
Deterministic encryption using AES-SIV
Format preserving encryption
Cryptographic hashing
In this post, it was mentioned some keys and steps to achieve the transformation using the Deterministic encryption however you can use the one you prefer.
As it was answered, the easy way to do this is following the Dataflow pipeliene tutorial
Last but not least, I share with you an example of how to de-identify by replacing the data generated by a faker library that I used to simulate your BigQuery data.
from faker import Faker
from google.cloud import dlp_v2
fake = Faker()
dlp = dlp_v2.DlpServiceClient()
def create_fake_data(data_length=5):
data = []
headers = [
{"name": "name"}, {"name": "email"},
{"name": "credit_card"}, {"name": "credit_card_provider"},
{"name": "phone"}]
for i in range(data_length):
data.append({"values":
[
{"string_value": fake.unique.first_name()},
{"string_value": fake.free_email()},
{"string_value": fake.unique.credit_card_number()},
{"string_value": fake.credit_card_provider()},
{"string_value": fake.phone_number()},
]
}
)
return {"table": {"headers": headers, "rows": data}}
def deidentify_with_replace(item):
parent = "projects/julio-castor-mx"
inspect_config = {"info_types": [
{"name": "EMAIL_ADDRESS"},
{"name": "CREDIT_CARD_NUMBER"},
{"name": "PHONE_NUMBER"}]}
deidentify_config = {
"info_type_transformations": {
"transformations": [
{
"primitive_transformation": {
"replace_config": {
"new_value": {"string_value": "[IDENTIFIED]"},
}
}
}
]
}
}
response = dlp.deidentify_content(
request={
"parent": parent,
"deidentify_config": deidentify_config,
"inspect_config": inspect_config,
"item": item
}
)
return response.item
if __name__ == "__main__":
data = create_fake_data()
deidentify_data = deidentify_with_replace(data)
Please consider that the InfoType parameter define the DLP detectors that create the de-indentify. These detectors are listed here and to de-indentify a table use the Table object.
You can see more examples in this repository

How to write parameter name with space in it? Custom Integromat apps

Api sends me a response with "Joined at" parameter, and I cant do anything with it because of the space " ", but that paramter is vital for one trigger in my Integromat app.
"trigger": {
"id": "{{item.id}}",
"date": "{{item.attributes.Joined at}}",
"type": "date",
"order": "desc"
}
Response example
You can use backticks to retrieve collection properties, as explained in the docs.
The expression will look like this: "date": "{{item.attributes.`Joined at`}}"

Unexpected response data from HERE autosuggest endpoint

The response from HERE's /autosuggest endpoint has unexpected element in it.
When making a request to Here autosuggest endpoint like: https://places.cit.api.here.com/places/v1/autosuggest?at=51.73771300000001,19.454722&q=wlokniarzy 91&maxresults=10&language=sv&additionaldata=Country2,true&cs=pds&result_types=address,place&addressFilter=countryCode=POL
In the response third element looks like:
{
"title": "91",
"highlightedTitle": "<b>91</b>",
"vicinity": "92-432 Lodz",
"highlightedVicinity": "92-432 Lodz",
"position": [
51.79221,
19.42193
],
"category": "900-9400-0401",
"categoryTitle": "Street or Square",
"bbox": [
19.421049,
51.791988,
19.422041,
51.792599
],
"type": "urn:nlp-types:place",
"resultType": "address",
}
Which I think should not show up looking like that.
It hard to even guess what this place suppose to be.
Is it a bug in Here autosuggest endpoint?
We will take a look at the place, and the place should be removed from Place API.
Thank you for the report!

Workfront API: Human readable status for Issues and Projects

https://support.workfront.com/hc/en-us/articles/115003574147-API-Basics
https://support.workfront.com/hc/en-us/categories/202718477
Querying objects (i.e.: GET /attask/api/v9.0/project/4c78821c0000d6fa8d5e52f07a1d54d0) returns a response similar to the following:
..
"status": "INP",
...
How do you get human readable statuses form these responses? Do you hard-code all possible values, or, can it be achieved using queries?
i.e.: "INP" > "In Progress"
You can pull these values from the Custom Enumeration tables (CSTEM). For example, this will return all the task descriptions:
https://subdomain.my.workfront.com/attask/api/v9.0/CSTEM/search?apiKey={{apiKey}}&fields=*&enumClass=STATUS_TASK&enumClass_Mod=in
You will get something like this:
{
"color": "FF3939",
"equatesWith": "CPL",
"groupID": "5419c94f00004a056282a15eed58e47f",
"label": "Complete",
"objCode": "CSTEM",
"value": "CPL",
"ID": "57ed3a2000477cfb7368beb5d995bf88",
"customerID": "540f5a3f0019b...",
"description": "Task is fully completed",
"enumClass": "STATUS_TASK",
"extRefID": null,
"isPrimary": true,
"valueAsInt": null,
"valueAsString": "CPL"
},
For issues use "STATUS_OPTASK".
I created a dictionary and translating the statuses while reading the short version (INP > In Progress)

output directory structure in assemble

I am creating a static site using grunt.js and assemble. I have a data.json file used for building pages using assemble:
{
"articles": [
{
"author": "Brian",
"headline": "A Generation on the Hook 1",
"body": "cars, and start businesses by means of debt",
"slug" : "n-hook1",
"publish_on": "2014-10-10T04:00:00+00:00",
"url": "http://example.com/2014/oct/08/n-hook1/",
},
{
"author": "Brian",
"headline": "A Generation on the Hook 2",
"body": "As millions go to college, buy homes,",
"slug" : "n-hook2",
"publish_on": "2014-10-12T04:00:00+00:00",
"url": "http://example.com/2014/oct/08/n-hook2/",
},
],
}
I would like the output to be created in the following directories like this: 2014/oct/08/n-hook1/index.html. How can I create the directories in assemble?
Is this even possible with assemble.io? If there is something better, let me know. I am new to the js world and would like some direction. I did see this question but this seems to involve placing the files in different directories. Maybe I have to write a helper? If so, I am not sure where to start.
I like assemble because pages that are generated a completely upt o the client side rendering, and I just present the json data. Not sure if there is something better.
The grunt-assemble-permalinks plugin was the solution, it does what I need.

Resources