I have multiple client Id (i.e. xxx-xxx-xxxx) under one main account. I can access API by using one account id (xxx-xxx-xxxx) and get the API response.
But in my current application I need to get API response of multiple account id (i.e. xxx-xxx-xxxx, yyy-yyy-yyyy). Actually I want to avoid the API call in loop of multiple account id.
Now in my php library I can set one account that is
$user = new AdWordsUser();
$user->SetClientCustomerId($clientId);
Is there any way, so that I can set multiple account and get data in one single API call in google adwords ?
The SetClientCustomerId($clientId); method only accepts 1 parameter (1 client id), so no, you can't set multiple accounts and get data in one single API call.
Related
I am new and working on Snapchat APIs. I just want to know that is there any API on Snapchat to get multiple campaign's insights in a single API call?
I am able to get insights using this API -
"https://adsapi.snapchat.com/v1/campaigns/<campaign_id>/stats?granularity=DAY&2020-10-24T07:00:00.000-00:00&end_time=2020-10-26T07:00:00.000-00:00&swipe_up_attribution_window=28_DAY&view_attribution_window=7_DAY&fields=conversion_purchases,impressions,swipes,spend&conversion_source_types=web,app,total"
but it's only for single campaign_id. However I want to get insights for multiple campaign_ids in a single API call within a time range. how can i do that?
Get insights for multiple campaigns in single API call within time range?
I've been looking for a way to get SendGrid stats for specific campaigns. I can see the stats on the Campaigns page of the SendGrid dashboard, but I can't find an API endpoint to get that data.
I could retrieve the Global and Overview stats, no problem, but in this case, those are not helpful for me. I need per-campaign stats. Is there a way to get those reports through the API?
Campaign level stats are not available via the official Sendgrid API, at least not that I could find.
However, there are a couple of undocumented URLs you can use to get campaign level stats:
https://sendgrid.com/marketing_campaigns/campaigns/CAMPAIGN_ID/stats.csv
^ this returns data in CSV format
https://sendgrid.com/marketing_campaigns/campaigns/CAMPAIGN_ID/stats.json
^ this returns data in JSON format
Note that these are the endpoints used by the Sendgrid web client, and so require authentication via Cookie token.
To obtain a token you can use the https://api.sendgrid.com/v3/public/tokens endpoint, and send your username and password in the payload.
Then you can send that token as a Cookie along with your requests to the above Sendgrid web client endpoints. Note, you must use cookie name mako_auth_token.
I solved my situation by creating unique (ID-like) categories for each campaign. This way, I can use the Category Stats API Endpoint. It's not a semantically correct usage of categories, but this is the only way I found to achieve this.
Update July 2017:
I also achieved this goal + much more by using SendGrid Subusers and the on-behalf-of: subuser_<username> header (search on behalf of subuser in the left searchbox). This header allows you to create requests using the parent account on behalf the subuser.
I'm trying to identify the user who is making Twilio requests from my system. Is there a way I can encrypt the information of this user, send it to Twilio along with the allowed parameters & receive the same along with Twilio's response?
EDIT: I may not have been very clear. I'm trying to make calls using Twilio's API from a web-app (PHP). I need to send the user (who is trying to establish the call)'s details & our API key to Twilio so that I can identify the user when I receive the response from Twilio.
You can include custom URL parameters in Twilio's webhook callback URL. Although the Twilio system itself will not make use of this information, it will be passed back to your php application when the call is answered. You can use this information to correlate the call to a user or other application specific concept. Here's an example:
$call = $client->account->calls->create(
'9991231234', // From a valid Twilio number
'8881231234', // Call this number
// Call this URL when a call connects and include the custom user_id parameter
'http://www.yoursite.com/handle_call.php?user_id=41423’
);
You can find more information about how the Twilio REST API and webhooks work together in the Twilio Skills training.
I doubt if it is twilio's responsibility to store additional information that you need to be otherwise handling yourself on your system. Why would twilio take operational overload from your end? Twilio probably has a confirmation token or request id for the twilio request that your system makes (returned via XML/ Json by its API server). You can take that ID and store it against the user_id inside your database (SQL / Mongo / Redis). Use that table to extrapolate information you need such as.
The number of requests each user made initiated.
The kind of requests made.
What time each request went out.
Result / Response from each request.
Hope this helps.
I want to use magento rest api authorization for my web application customers, I found in docs that there is /customers/:customerId request, to get information about user, but I can't understand, how to get customerId to make this request. Is there such a method in Magento REST API and if not, how I can get authorized customer Id via REST API.
There is a REST service to get a list of all existing customers and their customerId. Its a GET request to /customers. You can find its description in the REST API docs http://www.magentocommerce.com/api/rest/Resources/resource_customers.html#RESTAPI-Resource-Customers-HTTPMethod-GET-customers
Unfortunately there is no service to authenticate users using username and password that I know of. Not even in the SOAP API that has much more services than the REST API.
I'm trying to make app that use myintervals API.
And I need to check for project members contact information.
In order to make API call for each person for it contacts, I'd like to dump contacts for all persons in project(or company), so I could make 1 API request, not a 100.
Unfortunately I didn't found how to perform such request.
May I have some help about it?
According to the API definition the person resource expects an integer so there isn't a way to exclude it or add more than one id via a comma-delimited list of people ids.
http://www.myintervals.com/api/resource.php?r=personcontact
The only way to get at them will be one per request. Try sending an email to support to see if the requirement can be lifted or modified to allow multiple ids to be sent.