How to get woocommerce subscriptions list? - list

I want to get list of all subscriptions in the WOOcommerce products.
Is there a built-in function or i have to use WP_QUERY thing to access that particular thing ?

Try WC_Subscriptions::get_subscriptions().
Parameters for customising the output are documented in the function's doc block.

Related

Parameters on Nested Facebook API Request?

I am trying to make a call to Facebook using their Graph API Explorer, to try and find the following information about an ad:
Its adset,
Its branded page (if any),
Insights about its 100% video views.
To do that, I have constructed the following URL:
act_1234/ads?fields=id,adcreatives{branded_content_sponsor_page_id},insights{video_p100_watched_actions}&limit=1000
However, when I receive back the insights list, it is giving me just one row, for the last month. If I was making a call directly to insights, I would add the 'timeincrement=1' parameter to separate this out by day. Is there a way to add second-tier parameters to a nested query like this?
You can pass parameters to nested queries this way:
act_1234/ads?fields=id,adcreatives{branded_content_sponsor_page_id},insights.fields(video_p100_watched_actions).date_preset(lifetime).time_increment(1)

G Suite Admin SDK - get users list based on query with field schemaName.fieldName

I'm trying to get only users list based on a query.
According to the Google API client documentation for python, it will look something like this:
https://google-api-client-libraries.appspot.com/documentation/admin/directory_v1/python/latest/admin_directory_v1.users.html#list
where query=some_string
I've tried getting users based on specific fields for example givenName
In that case, it would be query=givenName:some_name. This works!
However I would like to get a list of users based on the custom user attribute. According to the documentation, that would mean the field would be schemaName.fieldName
https://developers.google.com/admin-sdk/directory/v1/guides/search-users
However I've tried query=schemaName.fieldName?SSO.role but to no avail and I can't find specific examples for this field online.
How would the query look for this? My schemaName=SSO and fieldName=role
Thanks!
Answered by Morfinismo as a comment.

How to update campaigns content with template in mailchimp

I want to use mailchimp to send mail when something happen automatically , so i use mailchimp restful api to do this:
1.Create a campaign with api /campaigns
2.Update the campaign with api /campaigns/{campaign_id}/content
3.Send the campaign
in this second step, i found the API /campaigns/{campaign_id}/content can update the campaign's content with plaintext or html easy with http body like this:
{"html": "<p>The HTML to use for the saved campaign<./p>"}
but i am not sure how to use a template to update the content.
In the API document(https://developer.mailchimp.com/documentation/mailchimp/reference/campaigns/content/#), if you want to use template update content, you need fill the template id and template sections, but how do i know the sections in a template?
I try to use the template api to get a template detail information, in the response, the section filed is empty array.
any suggestion? or give me example!
thank you guys
Regard to great developers
Not sure if you ever found an answer, but I am struggling with this API too. The sections can be retrieve from the GetDefaultContent API which will return an MailChimp Response with a sections object. That object, in turn, will have all the sections that you have specified in your template by name and their default content.
I am still trying to figure out the updating part, myself, but hope this helps a bit.

Hide a list in sharepoint but update it with javascript api

Ι am aware of the fact that I can use permission levels to hide a certain list from others. At the same time, I would like to use the javascript api to write to the same list. That it, I would like to use the list as an internal data keeping list not visible to all but accessible to everyone (through the api).
Is this possible? I am asking because if you set permission levels on who gets to see the list, don't they (the permissions) affect what you can do with the api?
Thank you
Yes, the JavaScript APIs are limited in what they can do based on the permission of the user running the script.
You can use the JSOM API to make a hidden list, which will not be visible on the site contents page, but to which end users can still have access. This is similar to how the SharePoint 2010 Workflow History List is hidden. Use the JSOM API to set a list's Hidden property to be true, or when you create the list, set its custom schema XML so that the Hidden attribute of the List element is set to true; see here for a list schema XML reference.

how to get all parameters for a specific application

I have the below query
data_query = service.customerUsageReports().get(**{'date':'2015-01-07','parameters':'gmail:num_outbound_rerouted_emails'})
What I'm wondering is how to just receive all the gmail specific parameters without listing each one out individually....
This is the adminSDK reports API...
Thanks
This is unfortunately not possible.