Currently, I am using WhatsApp Business api cloud on one of my web project, I would like to register a customer's phone number but via api instead through meta, developer platform like following:

"Here is the image to register customer's number in the meta developer platform"

I want do this: (managing the phone numbers)

but via api, and later of that send the verification code via api as well. If someone can help me , telling me if that is possible and sharing documentation or the endpoint I would appreciate it very much, I've been looking at the documentation and postman's examples for 2 days without any success.

I'm sorry I didn't share the pictures directly, it is my first question on Stackoverflow

Thanks in advance, Greetings!

I have a list of IDs that are integers. If I do print(data_clients["id"]) I get something like:

4323324234 2342342344 5464564565 

Then I want to call an API (Google Ads) that uses those numbers as IDs (to know which data to retrieve). I have to do a loop (or something similar) to get the data from each ID.

I've tried this

for id in range(data_clients["id"]):                 query = (f''' WHATEVER ''')                 stream = ga_service.search_stream(customer_id = data_clients["id"], query=query)                 list_id = [] 

With this code I get the following error:

4323324234 has type int, but expected one of: bytes, unicode 

And if I try to convert the int to Unicode or bytes (with chr or to_bytes), I get

int too big to convert 

Maybe the solution is obvious, but I'm a Python/coding beginner, so I'm pretty confused.

Any ideas? Thanks!

I am following this package: https://github.com/googleads/google-ads-php. Here they said that I need to run this page:

https://github.com/googleads/google-ads-php/blob/main/examples/Authentication/GenerateUserCredentials.php

to terminal.

and I did it like:

php /locaation of the fie/GenerateUserCredentials.php 

After that I can get a link which is something like that:

https://accounts.google.com/o/oauth2/v2/auth?response_type=code&access_type=offline&client_id=535777736006-d1rp8msevnls2pmihk7b8l23j3vra7duh.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Fcallback&state=4e23ce963534701029c1a22d2de7848d034d8b0b0&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords

(Above link is demo purpose)

So, When I click on this link I redirect to my google account and give access to them and after that I redirect back to this following URL:

http://localhost:3000/auth/callback?state=fddbaae6583b15aba552f682fe9f018233388533555f&code=4%2F0AfgeXvs4NV49mrqEBrl81ATRnXhqcu9x9ja8SAbaENSWhmNejGRGkZJE_AcD1aAFWdrlGg&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords

Here you can see I have 2 params which is state and code.

Now my question is how can I get the access token and refresh token using this URL?

I have multiple keywords for which I am looking for some related keyword ideas along with their metrics. For that, I am using google-ads-api's GenerateKeywordIdeasRequest. It takes a list of keywords, but right now I am passing a single keyword at a time. After that I convert the output into a dataframe and pick the top 3 keywords ideas based on their monthly search volume.

for example: if passed "bottle", it would return

and from there I would extract the top 3 keyword searches suggested for "bottle".

But with this approach, it takes a lot of time to generate ideas for all input keywords. So I tried passing all input keywords at once, which reduce the processing time dramatically but the issue is, I am not able to get the top 3 suggested keyword for each input keyword separately as all suggested keywords ideas for each input are now mixed. And It is hard to tell which is suggested for which passed input.

Here is the code I am using

import pandas as pd from google.ads.googleads.client import GoogleAdsClient class GoogleAD:     def __init__(self):       pass          def get_keywords_search_volume(client, customer_id, location_ids, language_id, keyword_texts, page_url= None):         """function to get keyword search volume from google ads API """         keyword_plan_idea_service = client.get_service("KeywordPlanIdeaService")         keyword_competition_level_enum = (client.enums.KeywordPlanCompetitionLevelEnum)         keyword_plan_network = (client.enums.KeywordPlanNetworkEnum.GOOGLE_SEARCH_AND_PARTNERS)         location_rns = GoogleAD.map_locations_ids_to_resource_names(client, location_ids)         language_rn = client.get_service("GoogleAdsService").language_constant_path(language_id)                  # Either keywords or a page_url are required to generate keyword ideas         # so this raises an error if neither are provided.         if not (keyword_texts or page_url):             raise ValueError(                 "At least one of keywords or page URL is required, "                 "but neither was specified."             )                  # Only one of the fields "url_seed", "keyword_seed", or         # "keyword_and_url_seed" can be set on the request, depending on whether         # keywords, a page_url or both were passed to this function.         request = client.get_type("GenerateKeywordIdeasRequest")         request.customer_id = customer_id         request.language = language_rn         request.geo_target_constants = location_rns         request.include_adult_keywords = False         request.keyword_plan_network = keyword_plan_network                  # To generate keyword ideas with only a page_url and no keywords we need         # to initialize a UrlSeed object with the page_url as the "url" field.         if not keyword_texts and page_url:             request.url_seed.url = page_url                  # To generate keyword ideas with only a list of keywords and no page_url         # we need to initialize a KeywordSeed object and set the "keywords" field         # to be a list of StringValue objects.         if keyword_texts and not page_url:             request.keyword_seed.keywords.extend(keyword_texts)                  # To generate keyword ideas using both a list of keywords and a page_url we         # need to initialize a KeywordAndUrlSeed object, setting both the "url" and         # "keywords" fields.         if keyword_texts and page_url:             request.keyword_and_url_seed.url = page_url             request.keyword_and_url_seed.keywords.extend(keyword_texts)                  keyword_ideas = keyword_plan_idea_service.generate_keyword_ideas(request=request)                  for idea in keyword_ideas:             competition_value = idea.keyword_idea_metrics.competition.name         return keyword_ideas          def map_locations_ids_to_resource_names(client, location_ids):             """Converts a list of location IDs to resource names.             Args:                 client: an initialized GoogleAdsClient instance.                 location_ids: a list of location ID strings.             Returns:                 a list of resource name strings using the given location IDs.             """             build_resource_name = client.get_service(                 "GeoTargetConstantService"             ).geo_target_constant_path             return [build_resource_name(location_id) for location_id in location_ids]          def get_keyword_df(key_word):          """function to generate dataframe with keyword search volume"""         try:             client = GoogleAdsClient.load_from_storage('desc.yaml')             list_keywords = GoogleAD.get_keywords_search_volume(client, "686xxxxx647", ["2840"], "1000", key_word, None)             keyword_df = pd.DataFrame()             for idea in list_keywords:                 keyword_dict = {}                 competition_value = idea.keyword_idea_metrics.competition.name                 idea_text = idea.text                 monthly_search_volume = idea.keyword_idea_metrics.avg_monthly_searches                 keyword_dict['idea_text'] = idea_text                 keyword_dict['monthly_search_volume'] = int(monthly_search_volume)                 keyword_dict['competition_value'] = competition_value                 keyword_dict['key_word'] = key_word                 keyword_dict['key_word_modified'] = key_word.replace('%',' percent')                 keyword_series = pd.Series(keyword_dict)                 keyword_df = keyword_df.append(keyword_series, ignore_index = True)         except Exception as e:             print(e)             # print(e.args[2])             keyword_df = pd.DataFrame()         return keyword_df suggestion_df = GoogleAD.get_keyword_df(['bottle']) 

Let me know if there's any more information I can provide.