Pull list of campaigns from Google Adwords API? - api

The Google Adwords API documentation is super difficult to navigate.
I know I am missing something. How can I pull a list of the campaigns under a certain account? Is there a report that includes it or API call? I can use a list of IDs or names but I can't find either.

Take a look at Google's googleads github repo.
https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201506/reporting/download_criteria_report.py
This is an example of downloading a criteria performance report.
Change reportType to CAMPAIGN_PERFORMANCE_REPORT.
In the selector object, change fields to the fields you want out of the list - https://developers.google.com/adwords/api/docs/appendix/reports/campaign-performance-report
If you want to add an id filter then you need to add a predicates object to the selector that looks like:
{'field': 'CampaignId', 'operator': 'IN', 'values': campaign_ids}
Not all fields in the campaign are available in the reporting section. In this case I would suggest to use the campaign service to download the campaigns. Keep in mind that this operation is slower than reporting.
Take a look at this example from the googleads repo - https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201506/basic_operations/get_campaigns.py

Related

How to retrieve listing price data for specific event using ticketmaster's developer API?

I made a Ticketmaster developer account and I would like to pull listing price data for specific events. I am able to retrieve this type of listing data for specific events using Stubhub's API, but looking through Ticketmaster's API documentation, I don't see any specific API requests that will return listing data, such as section, row and listing_price.
Am I missing something, or is it not possible to retrieve this type of listing data using Ticketmaster's API?
For anyone who stumbles upon this in the future, TicketMaster does offer this functionality through their availability endpoint. However you have to be a TM nexus partner to use it, and getting approved as a partner depends on what your business/software does and income etc...

Get Salesforce Account fields

I am doing the specifications using Salesforce API
I searched so much but didn't find the list of fields that i could retrieve using GET method
Someone could provide me the link that give me this list please ?
I just found this link
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_get_field_values.htm
Thank you
You need to use a "describe" call. It'll return a list of all objects your user can see in the org and it'll include links how to get more detailed info about all fields on say Account. (you can jump straight to describing an Account if you want, the links are constructed in a predictable pattern)
"Describes" are limited to what your Profile can see so if the profile lacks the "Read" checkbox on some object - it won't appear in the results.
Go to https://workbench.developerforce.com for example and experiment (from menu select Utilities -> REST explorer)
Base call that lists all APIs available to you: /services/data/v41.0
List of all sObjects & links to obtain more info about them: /services/data/v41.0/sobjects
Detailed info about Account, including fields: /services/data/v41.0/sobjects/Account/describe

Social Tables data model

I've just started looking at the documentation as we are going to need to integrate Salesforce with Social Tables shortly, so I am really new to Social Tables.
Specifically, we will need to sync data between the CRM and Social Tables Events and Guests, and maybe other objects, so it would be very helpful to have a data model or similar to check the relationships and fields available in Social Tables architecture.
I haven't found anything in the documentation, is there any way to get this, even if it's at a high level?
Thanks
Danny
To make an integration with SocialTables you'll have to do a few manual steps, there is no way to do this completely programmatic from my experience. You'll also have to be prepared to contact SocialTables to get get correct guestlist ids. Also keep in mind that the API documentation isn't always correct, the API logic is also quite difficult to understand from time to time.
The first thing you need to do is figure out which version of the Venue Mapper you use. You'd want to use the 4.0 api and as far as I know this version of the api is only supported by Venue Mapper 3.0. I believe the Venue Mapper 3.0 is the frontend tool SocialTables provides to do the venue planning.
In social tables an event has two ids, one numerical one and one alpha-numerical one, when you use the 4.0/events endpoint you only get the alpha-numerical event id, and your going to need the numerical one. The only way I've been able to get the numerical id is to pull it out from the url when using the Venue Mapper, example of the url follows below:
https://plan.socialtables.com/team/{team_id}/event/{event_id}/space/{space_id}
Now you need to get the guestlist id, you can get that by using the following url, using the numerical event id:
GET https://api.socialtables.com/4.0/diagrams?event={numerical_event_id}
This endpoint return a json structure where one of the parameters is "guestlist_id".
Please be aware that the guestlist id you get from this endpoint might not be the correct one. I struggled quite a bit with this part and ended up with SocialTables sending me the guestlist id by email.
To get the guests in your guestlist use the following api endpoint:
GET https://api.socialtables.com/4.0/guestlists/{guestlist_id}
The {guestlist_id} is an alpha-numerical string similar to: cfdac1c0-yb1d-12e6-84a5-a39e92131645
And by that you should hopefully get access to your guests.
Hey thanks for using our API.
To answer your question, the best way to see the data model at the moment is to access our developer portal and use the API console to see what is returned. For events you will need to know the team id of the team you are working with use the team events endpoint to get access to the event ids.
https://developer.socialtables.com/api-console#!/Events/get_4_0_legacyvm3_teams_team_events
This will return some basic information about each event for that team. You can then request additional details for specific events by using this endpoint:
https://developer.socialtables.com/api-console#!/Events/get_4_0_legacyvm3_events_event

flickr API, getClusterPhotos with license filter

I am getting a collection of photos via this flickr API:
description: http://www.flickr.com/services/api/flickr.tags.getClusterPhotos.html
example: http://www.flickr.com/services/api/explore/flickr.tags.getClusterPhotos
I see no option to include the license parameter on the API query and I thus get copyrighted images returned, which I do not want. I see that I can get the license info by calling flickr.photos.getInfo on each individual image, but this will be quite time consuming. Are there any other methods to get a collection of photos from a tag cluster with a particular license?
License is one of the parameters listed in their api here:
http://www.flickr.com/services/api/flickr.photos.search.html
I would try just using the id's from the results listed here in their return:
http://www.flickr.com/services/api/flickr.photos.licenses.getInfo.html
for example:
&license=4
It may be better to use "flickr.photos.search" instead. You can search for a specific tag and license (there is no need to do a second call on each image).
https://www.flickr.com/services/api/explore/flickr.photos.search

eBay API - filter items by store/custom categories

My scenario: I have a client with an eBay store with custom categories. On their website, they would like to list the items they have for sale. They would like this list to be filterable by custom category.
I've been searching for a couple days now, and I'm still a bit unsure about the best way to proceed.
From what I can gather, the only way to get a list of categories defined in a store is through the GetStore call in the Trading API. This seems to be supported, though I need to get a user token from my client's eBay account. I will assume this works.
I do not, however, see any method of filtering items based on custom categories. I've looked through the documentation of both the Trading and Finding APIs, but all I see are filters on pre-defined eBay categories.
Is it possible to filter on custom/store categories?
I had a task to link seller products to custom categories and the only way I found is to retrieve a list of custom categories with "GetStore" from Trading API, retrieve all seller items with "findItemsAdvanced" call form Finding API, and loop through all retrieved items and get details with "GetItem" call from Trading API.
After that I could find custom categories under $xml->Item->Storefront->StoreCategoryID and $xml->Item->Storefront->StoreCategory2ID.
After digging through and posting in the eBay forums, I found out that no, it is not possible to filter on custom/store defined categories via the API. The only way to filter on custom/store defined categories is on the eBay hosted store.
This is apparently eBay's way to make the store hosted on their site more feature rich than anything you can do via the API.
Even though this question is old, I believe it interesting to give a more recent answer. As stated above, you cannot directly filter items sold by a store using custom store categories (StoreCategoryID). The easiest way to work around this is using the GetSellerList API using a coarse granularity level, which allows you to get the storeCategoryID of each Item on sale within a starting time range or an end time range. You can then filter the items yourself. Here's a link to a forum answer: https://ebay.custhelp.com/app/answers/detail/a_id/1178
Yes no way to get items by Custom categories.
It sounds like either getCategoryInfo or GetCategories might help you.