Website URL in create an app

oauth

#1

I am trying to create my first app but I don’t understand what is Website URL and Callback URLs?


#2

if I added my twitter account URL is it true?
also, I set up a dev environment but what is the next step?
I see this post


search_tweets_fullarchive_dev: 
account_type: premium 
endpoint: <FULL_URL_OF_ENDPOINT>
 bearer_token: <TOKEN>

what is FULL_URL_OF_ENDPOINT?
how can i get it is there any example?


#3

Hi @fatiima_mb - did you manage to figure this out?


#5

No


#6

Hello @fatiima_mb

Website URL is simply the URL for any website that you might own. I don’t believe this is a required field.
You can learn more about Callback URL here: https://developer.twitter.com/en/docs/basics/apps/guides/callback-urls

If you are using the premium Full archive data endpoint, you are going to use the following as your <FULL_URL_OF_ENDPOINT>, making sure to replace dev with the dev environment name that you specified here.
https://api.twitter.com/1.1/tweets/search/fullarchive/dev.json

You will also have to replace <TOKEN> with a bearer token that you generate by following the instructions here:
https://developer.twitter.com/en/docs/basics/authentication/overview/application-only

So an example of this might look like this:

search_tweets_fullarchive_dev: 
account_type: premium 
endpoint: https://api.twitter.com/1.1/tweets/search/fullarchive/dev.json
 bearer_token: AAAAAAVELAEOIA368sd76a9sduvalkje

#7

thank you it is helpful, I created a YAML file but when I run this code I get this error

premium_search_args = load_credentials("C:/Users/DRC/Desktop/.twitter_keys.yaml",
                                       yaml_key="search_tweets_fullarchive_dev",
                                       env_overwrite=False)
cannot read file C:/Users/DRC/Desktop/.twitter_keys.yaml
Error parsing YAML file; searching for valid environment variables
Account type is not specified and cannot be inferred.
        Please check your credential file, arguments, or environment variables
        for issues. The account type must be 'premium' or 'enterprise'.
        

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-18-0e82e11b9e9a> in <module>
      1 premium_search_args = load_credentials("C:/Users/DRC/Desktop/.twitter_keys.yaml",
      2                                        yaml_key="search_tweets_fullarchive_dev",
----> 3                                        env_overwrite=False)

~\Anaconda3\lib\site-packages\searchtweets\credentials.py in load_credentials(filename, account_type, yaml_key, env_overwrite)
    187                    if env_overwrite
    188                    else merge_dicts(env_vars, yaml_vars))
--> 189     parsed_vars = _parse_credentials(merged_vars, account_type=account_type)
    190     return parsed_vars
    191 

~\Anaconda3\lib\site-packages\searchtweets\credentials.py in _parse_credentials(search_creds, account_type)
     80         """
     81         logger.error(msg)
---> 82         raise KeyError
     83 
     84     try:

KeyError:

#8

The error is reporting that your file cannot actually be read or found. Maybe check your directory structure?


#9

yes I fixed it and it can read it but I got this error
Error parsing YAML file; searching for valid environment variables


#10

This sounds like a file format issue.


#11

here is the YAML file I wrote, is there any mistake?

  search_tweets_fullarchive_dev:
  account_type: premium
  endpoint: https://api.twitter.com/1.1/tweets/search/fullarchive/dev.json
  consumer_key: Sz************************************
  consumer_secret: lP8*********************************************

#12

Looks like it was solved over here: https://github.com/twitterdev/search-tweets-python/issues/64 (it was yaml file white space formatting)


#13

yes all that because of white space :sob:
thank you all


closed #14