Google Calendar API - Can't add google meets to event - google-calendar-api

i'm using a service account to add events to my calendar, 1 month ago it was working with the code below, then after sometime it started to give me the error: 'invalid conference data type', i removed 'conferenceDataVersion' field and it started working again. Now it doesn't work both ways. When i test it from the Calendar API page it works fine with the same parameters, but on my app it's not working.
The event is added succesfully, but no google meets link is created.
I think that maybe i can't create an event of the type "hangoutsMeet" on a service account, while i was testing it worked because i was creating it from the same account. BTW i still can't figure out why it was working fine one month ago, nothing has changed. I was using the exact same configurations and code and i managed to create an event and to add a google meet conference to that evet.
calendar.events.insert( {
"calendarId" : 'primary',
"conferenceDataVersion": 1,
"resource":{
"end": {
"dateTime" : endDate.toISOString(),
'timeZone': 'Europe/Berlin'
},
"start": {
"dateTime" : startDate.toISOString(),
'timeZone': 'Europe/Berlin'
},
"conferenceData": {
"createRequest": {
"requestId": randomstring,
"conferenceSolutionKey": {
"type": "hangoutsMeet"
}
}
}
}
Any help appreciated. Thanks

Related

Fetch company posts from linkedin API

I am trying to fetch the posts of the company from the api, I have already applied to the marketing development platform and it was approved. I already got the token with the scope: r_organization_social and I'm calling the /shares api:
https://api.linkedin.com/v2/shares?q=owners&owners=urn:li:organization:{company_ID}&sharesPerOwner=100&count=25&sharesPerOwner=10
But I'm getting the following response:
{
"paging": {
"start": 0,
"count": 25,
"links": [
{
"type": "application/json",
"rel": "next",
"href": "/v2/shares?count=25&owners=urn%3Ali%3Aorganization%3A{company_ID}&q=owners&sharesPerOwner=10&sharesPerOwner=100&start=0"
}
],
"total": 242
},
"elements": []
}
I tried to change the query params and it's still the same
This end-point worked for me:
https://api.linkedin.com/v2/ugcPosts?q=authors&authors=List(urn%3Ali%3Aorganization%3A<ID_ORGANIZATION>)
See documentation: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/ugc-post-api?tabs=http#sample-request-6
Disclaimer: I've no access to the linkedin API and couldn't test. But these are some things I noticed:
Your url contains two times the paramater sharesPerOwner, try removing one.
In the docs it's recommended to set the sharesPerOwner to 1000 and the count to 50. I'd also include the start paramater, just to make sure:
Maybe try something like this:
GET https://api.linkedin.com/v2/shares?q=owners&owners=urn:li:organization:{id}&sharesPerOwner=1000&count=50&start=0
From the api-docs(https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/share-api?tabs=http#find-shares-by-owner): "Note that the pagination excludes UGC and Direct Sponsored Content (DSC) posts". Make sure that the owner you are testing contains posts.
If this doesn't work. Could you provide some information on how you are sending the request? Have you tried accessing other parts of the api?

Related LinkedIn Target Audience facets

i am new this linked-in ad campaign API i am not able to find out which facet combination is correct to achieve the specific targeting audience
and there is no JSON enter image description hereavailable to figure it out for proper combination
For Example - if i am selecting company_size with other facet i am not able to create LinkedIn campaign with targeting audience.
So i am not able to find out what is combination for linkedIn target audience,
You can take a look at the example in the doc, a working example for your scenario is:
{
"include": {
"and": [{
"or": {
"urn:li:adTargetingFacet:staffCountRanges": [
"urn:li:staffCountRange:(2,10)"
]
}
}, {
"or": {
"urn:li:adTargetingFacet:industries": [
"urn:li:industry:4",
"urn:li:industry:51"
]
}
}, {
"or": {
"urn:li:adTargetingFacet:locations": [
"urn:li:country:us"
]
}
}]
}
}
I've created a campaign with this targeting and the related targeting audience looks like:
Hope this help
NB: A bug exists in the doc, I didn't remember if the doc was updated
UPDATE:
Referring to the doc:
These facets names and facet values mentioned below are discoverable
using the adTargetingFacets and adTargetingEntities API.
You can also refer to this page for Ads Targeting Discovery.
You can use the explore API in order to find the right key values

firebase dynamic link generated via API open appstore

I'm creating a dynamic link via API.
How can I specify to open the AppStore if the app is not installed?
here the body for my request:
{
"dynamicLinkInfo": {
"domainUriPrefix": "https://wi.page.link",
"link": "https://wiapp.com.au/faq?promocode=mypromo_code",
"iosInfo": {
"iosBundleId": "com.direce.sr",
"iosFallbackLink":"id1356389392",
"iosAppStoreId":"id1368389392",
},
"socialMetaTagInfo" :{
"socialImageLink":"https://vignette.wikia.nocookie.net/doraemon/images/b/b8/Doraemon_2005.PNG/revision/latest?cb=20151207094313&path-prefix=en",
"socialTitle":"my titu",
"socialDescription":"descripotio"
}
},
"suffix": {
"option":"UNGUESSABLE"
},
}
this works if I create the dynamic link via firebase console, where I can specify what to do if app not installed
Ok!
found the problem, is the
"iosAppStoreId":"id1368389392"
it is different value if creating from the dashboard or for API,
so the correct one when doing from, API should be without the "id"
"iosAppStoreId":"1368389392"
You can add a parameter called iosInfo, which has a property called iosAppStoreId (the app store id).
Check the documentation page here.

Google Measurement Protocol Timing hit type not shown in Real-time report

I'm in the process of adding support for Google Measurement Protocol in my macOS desktop app. Doing pageviews and events works fine. However, I'm not sure that my timing hit type works fine.
When I send
https://www.google-analytics.com/collect?v=1&t=timing&tid=UA-xxx-1&cid=58xxx&utc=archive&utv=bla&utt=4
I get the usual pixel back. The Hit Builder also validates fine. However, for pageviews and events I see something in Real-Time report of Google Analytics. This doesn't happen for the timing hit type.
I've tried with the debug url and got back the following:
{
"hitParsingResult": [ {
"valid": true,
"parserMessage": [ ],
"hit": "/debug/collect?v=1\u0026t=timing\u0026tid=UA-xxx-1\u0026cid=58xxx\u0026utc=archive\u0026utv=bla\u0026utt=4"
} ],
"parserMessage": [ {
"messageType": "INFO",
"description": "Found 1 hit in the request."
} ]
}
What am I doing wrong?

Google Analytics API - Get page view information for specific URLs

I am looking to implement a page view tracking system on one of my websites.
The website is a directory where suppliers can advertise their services. Suppliers have a unique profile page on the site, e.g mysite.com/directory/abc-profile.html
The idea is that suppliers can log in to their account area on the site and view stats on how many people are visiting their profile. Ideally I want to display this as :
Total views | Total today | This week | This month | This year
It does not matter if the data is not completely up to date.
I already have Google Analytics tracking code installed on the site. Is it possible to use the Google Analytics API to retrieve this data? If so, what kind of query do I need to make? I had a look on the documentation but could not figure whether the functions allow this or not.
I am using PHP and MySQL on the server.
Yes - you will need to use the Google Analytics API for this. I would suggest checking out the Query Explorer to get a feel for the queries you will need to create.
You will require numerous queries to get all the data you need (adjusting the starting date):
- Total Views
- This Year
- This Month
- This Week (i.e. last 7 days - from which you could also get Total Today).
Here is an example query:
https://www.googleapis.com/analytics/v3/data/ga?ids=ga:1234456789&dimensions=ga:pagePath&metrics=ga:pageviews&filters=ga:pagePath==/about-us.html&start-date=2013-10-15&end-date=2013-10-29&max-results=50
Alternatively, you might want to consider www.embeddedanalytics.com (disclosure - I work with them). We have a service/platform that allows website owners to embed GA based charts/statistics without having to learn the GA API. We have a CMS version which will do exactly what you need (where you script the call to pass the page path). We have done something like this with a number of podcast sharing sites.
Google suggests using Reporting API V4 now. The accepted answer uses V3.
Here is a V4 request example:
POST https://analyticsreporting.googleapis.com/v4/reports:batchGet?key={YOUR_API_KEY}
{
"reportRequests": [
{
"viewId": "YOUR_VIEW_ID",
"dimensions": [
{
"name": "ga:pagePath"
}
],
"metrics": [
{
"expression": "ga:pageviews"
}
],
"dimensionFilterClauses": [
{
"filters": [
{
"operator": "EXACT",
"dimensionName": "ga:pagePath",
"expressions": [
"/your-path"
]
}
]
}
],
"dateRanges": [
{
"startDate": "2009-12-31",
"endDate": "2016-09-28"
}
]
}
]
}
where
YOUR_API_KEY - for auth related things follow this page
YOUR_VIEW_ID - you can use the Account Explorer to find a View ID. (or Admin -> View -> View Settings -> View ID).
For more documentation details and a "Try it!" console follow this page.
You should be able to add a filter on the landing page. I am assuming that each user's site has its own start page. This returns only the data for that user. If you want the code on how to do this I suggest you google: Google analytics core reporting API PHP tutorial
Another idea would be to let the user add there Google Analytics account to there profile. Then you can output the google analytics code onto there page. Then they can track there own google analytics data and you won't need to deal with any of it.
Thought I would provide an updated version as the others are showing for V3 and V4 - for anyone using the latest API for Google Analytics Data API (GA4). This is just grabbing the total users, over a date range for a specific path.
Note that the POST is hitting the v1 beta address as this was the latest at the time.
POST https://analyticsdata.googleapis.com/v1beta/properties/PROPERTY_ID:runReport
{
"dateRanges": [
{
"startDate": "YYYY-MM-DD",
"endDate": "YYYY-MM-DD"
}
],
"dimensions": [
{
"name": "pagePath"
}
],
"dimensionFilter": {
"filter": {
"fieldName": "pagePath",
"stringFilter": {
"matchType": "CONTAINS",
"value": "/YOUR/PATH"
}
}
},
"metrics": [
{
"name": "totalUsers"
}
]
}

Resources