load_pinterest_report¶
load_pinterest_report(destination_table, ad_account_id, report_template_id, client_id, client_secret, refresh_token)
Description¶
Download Daily Pinterest Custom Report
into destination_table
.
At each run, the function will always load data of the last 28 days. It will also backfill missing data up to one year.
To get the needed client_id
, client_secret
and refresh_token
from Pinterest, read their documentation here and then there.
If you need help in getting those, you can get help on BigFunctions Slack.
Usage¶
Call or Deploy load_pinterest_report
?
Call load_pinterest_report
directly
The easiest way to use bigfunctions
load_pinterest_report
function is deployed in 39 public datasets for all of the 39 BigQuery regions.- It can be called by anyone. Just copy / paste examples below in your BigQuery console. It just works!
- (You need to use the dataset in the same region as your datasets otherwise you may have a function not found error)
Public BigFunctions Datasets
Region | Dataset |
---|---|
eu |
bigfunctions.eu |
us |
bigfunctions.us |
europe-west1 |
bigfunctions.europe_west1 |
asia-east1 |
bigfunctions.asia_east1 |
... | ... |
Deploy load_pinterest_report
in your project
Why deploy?
- You may prefer to deploy
load_pinterest_report
in your own project to build and manage your own catalog of functions. - This is particularly useful if you want to create private functions (for example calling your internal APIs).
- Get started by reading the framework page
Deployment
load_pinterest_report
function can be deployed with:
pip install bigfunctions
bigfun get load_pinterest_report
bigfun deploy load_pinterest_report
Keep the secrets safe!
Do NOT write secrets in plain text in your SQL queries!
Otherwise, anyone with access to your BigQuery logs can read and use them.
Instead, generate an encrypted version that you can safely share:
- Enter a secret value below along with the emails of the users who are authorized to use it (separated by commas).
- Click on
Encrypt Secret
. - The browser (no server is called) will generate an encrypted version and copy it in the clipboard
- Paste the encrypted secret into the arguments of your function exactly like if you passed the plain text version.
- The bigfunction will decrypt it and check that the calling user is authorized.
More on secret encryption
Technically, this encryption system uses the same encryption mechanism used to transfer data over the internet. It uses a pair of a public and private keys.
The public key (contained in this web page) is used to encrypt a text. The corresponding private key is the only one who is able to decrypt the text. The private key is stored in a secret manager and is only accessible to this function. Thus, this function (and this function only) can decrypt it.
Moreover, the function will check that the caller of the function belong to the list of authorized users
that you gave at encryption time.
Thanks to this:
- Nobody but this function will be able to decrypt it.
- Nobody but
authorized users
can use the encrypted version in a function. - No function but the function
load_pinterest_report
can decrypt it.
Examples¶
call bigfunctions.eu.load_pinterest_report("your_project.dataset.table", 12345, 678910, "123445666", "ENCRYPTED_SECRET(kdoekdswlxzapdldpzlfpfd)", "ENCRYPTED_SECRET(sqdksdoxlkwcmll;d;smgre)");
call bigfunctions.us.load_pinterest_report("your_project.dataset.table", 12345, 678910, "123445666", "ENCRYPTED_SECRET(kdoekdswlxzapdldpzlfpfd)", "ENCRYPTED_SECRET(sqdksdoxlkwcmll;d;smgre)");
call bigfunctions.europe_west1.load_pinterest_report("your_project.dataset.table", 12345, 678910, "123445666", "ENCRYPTED_SECRET(kdoekdswlxzapdldpzlfpfd)", "ENCRYPTED_SECRET(sqdksdoxlkwcmll;d;smgre)");
Need help or Found a bug?
Get help using load_pinterest_report
The community can help! Engage the conversation on Slack
We also provide professional suppport.
Report a bug about load_pinterest_report
If the function does not work as expected, please
- report a bug so that it can be improved.
- or open the discussion with the community on Slack.
We also provide professional suppport.