How to assign ad account to business manager account using facebook ads API? - facebook-ads-api

I am implementing functionality to Claiming ad accounts using Facebook ads API & I found their following documentation link.
https://developers.facebook.com/docs/marketing-api/businessmanager/assets/v2.9
And I have prepared & made API call accordingly but its not working and returning following error.
"(#275) Cannot determine the target object for this request. Currently supported objects include ad account, business account and associated objects."
Here is the API call I am using.
curl \
-F "adaccount_id=act_<AD_ACCOUNT_ID>" \
-F "access_type=OWNER" \
-F "access_token={ACCESS_TOKEN}" \
"https://graph.facebook.com/{API_VERSION}/{BUSINESS_ID}/adaccounts"
I have passed valid business id, adaccount id & access token in my API call.
Please help me. Any help will be appreciated.
Thanks.

Related

Get Google Sheet Data using V4 API without OAuth

Using this nodeJS example, I could get the data from a public sheet.
But how do I get the data from a non-public sheet owned by me (my google a/c) ?
Is there some way to send in the username and password as arguments ?
I don't want OAuth way as I want the data to be pulled from the sheet & displayed on a public webpage.
The other option I can think of is to have OAuth2 done once write a script to handle refresh tokens automatically as a cron every hour ?
Since this is a file that you the developer own i would recommend using a service account
If you share the file with the service account it will then have permissions to access it without you needing to go though the oauth2 steps of authorizing your application.
On google cloud console simply create Service account credentials
const {google} = require('googleapis');
const auth = new google.auth.GoogleAuth({
keyFile: '/path/to/your-secret-key.json',
scopes: ['https://www.googleapis.com/auth/spreadsheets'],
});
Then change your auth code slightly. Open the service account key file and look for the service account email address its the only one witha # in it. Share the file with the service account like you would any other user in google drive web app.
Once it has access you shouldn't need to authorize the app again.
I have a video on Google drive API upload file with Nodejs + service account which might help you a bit you just need the authorization code. Everything else you have should work as is.

Can I access Direct APIs in my app instead of using Docusign SDK and is there any endpoint to get envelopes based on recipient email id or name?

As my app is designed using flutter and all my app endpoints are created using Springboot. So can call direct APIs using Feignclient in Springboot to create my own endpoint to list all the envelopes for one recipient?
Do we have any endpoint to get all the envelopes by using the recipient name or email id? for example XYZ user needs to sign in 2 envelopes then using XYZ can we be able to fetch those 2 envelopes?
Yes, you are very welcome to call the eSignature REST API directly and not use an SDK. Use API version 2.1. About half of the developers who use the API do so directly.
Updated: authentication
To call the eSign REST API, each of your API calls must include authentication via an access token. You can obtain an access token via an OAuth flow.
If your users have DocuSign user accounts, then they should login/authenticate via Implicit grant assuming that you're using Flutter for a mobile app.
If your users don't have DocuSign accounts (they are signers, not senders), then you need to have a backend server that can securely use the JWT grant flow to obtain an access token on behalf of a "system" account such as "finance#example.com"
If you have questions about authentication, please open a new question on StackOverflow.
https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/liststatuschanges/
This endpoint has lots of filtering options including:
email={email_address} Limit results to envelopes sent by the account user with this email address.
user_name must be given as well, and both email and user_name must refer to an existing account user.
user_name={user_name} Limit results to envelopes sent by the account user with this user name.
email must be given as well, and both email and user_name must refer to an existing account user.

Ads Management API multi account management

I am creating a Facebook app for providing insight into companies ad accounts, and I need to be able to have access to multiple accounts. Before I get started I want to make sure I can manage multiple companies Ad Accounts and report on them.
Do I need to use Facebook's "Ads Management API" along side of the "Ad Insights API"? And will either API provide multi account access?
Thank you
I know the Ads API allows you multi account access. For example, if you look at the Facebook Python SDK Readme, they give an example of using multiple accounts. I've included the relevant code below:
my_app_id = '<APP_ID>'
my_app_secret = '<APP_SECRET>'
my_access_token_1 = '<ACCESS_TOKEN_1>'
my_access_token_2 = '<ACCESS_TOKEN_2>'
session1 = FacebookSession(
my_app_id,
my_app_secret,
my_access_token_1,
)
session2 = FacebookSession(
my_app_id,
my_app_secret,
my_access_token_2,
)
api1 = FacebookAdsApi(session1)
api2 = FacebookAdsApi(session2)

Getting list of documents related to a particular user in Google Apps using Admin Account

i am creating an app using google apis.i need to access user's documents through google apis using google admin account.In past i can use google docs api like this
for example i am admin of domain iritesh.com and my email address is ritesh#iritesh.com.i logged in using admin account and can retrieve documents in google drive of rajat#iritesh.com using user_id = rajat#iritesh.com.
https://docs.google.com/feeds/"+user_id+"/private/full/folder:root/contents?v=3&alt=json
but now google docs api's are deprecated.can anyone please guideline How to acheive this using google apis now.
link reference : https://developers.google.com/google-apps/documents-list/#using_google_apps_administrative_access_to_impersonate_other_domain_users
With the new API's and OAuth 2 you can accomplish this functionality but for it you will have to use Service account with domain wide delegation.
Basically with the service account it would be possible to impersonate users in the domain and make API calls in user's behalf. For getting information about documents you will use the Drive API.
Here is the documentation on service account:
https://developers.google.com/accounts/docs/OAuth2ServiceAccount
And Drive API:
https://developers.google.com/drive/v2/reference/
hope this helps.

Get client_id and service_email from google analytics

I developed web application where I need to allow users to embed their google analytics dashboard. In order to access analytics dashboard I need client_id and service_email.
Is there a way to grab client_id and service_email using OAuth, I don't want to force users to manually create client_id so they can integrate dashboard.
Just to mention I'm using Laravel 4.
I get what's the issue here.
You actually have to set up a new project in https://console.developers.google.com. That is where you actually enable OAuth to Access Google Analytics API. The client_id and service_email you are referring to are actually the developer's one, which are accessible under Project > API & auth > Credentials in the Dashboard.
There's quite a lot to take in. I'll be available to clarify concepts for you.
References:
https://developers.google.com/accounts/docs/OAuth2
https://developers.google.com/console/help/new/

Resources