Coder Social home page Coder Social logo

Authentication 404 Error about pyairtable HOT 7 CLOSED

gtalarico avatar gtalarico commented on May 23, 2024
Authentication 404 Error

from pyairtable.

Comments (7)

gtalarico avatar gtalarico commented on May 23, 2024 1

I am sorry I don't understand the question. Can you include a code snippet?
url_safe_table_name is an internal local variable and does need to be touched.
I tested against one of the default bases and it seems to be working fine.

>>> from airtable import Airtable
>>> table = Airtable(base_key='appEioitPbxI72w06', table_name='Editorial', api_key='keyMyKey')
>>> table.get_all()
[{'id': 'rec9B3nlOhIxUVX1e', 'fields': [... TRUNCATED]
>>> table.url_table
'https://api.airtable.com/v0/appEioitPbxI72w06/Editorial'

Note the generate url matches the documentation, minus the api_key which is added in the request headers instead of url query params

image

from pyairtable.

 avatar commented on May 23, 2024 1

Ok, thanks a bunch!

Not to flock this issue with unrelated questions, but I noticed the airtable API doesn't allow for creating and reading comments. You haven't found a way to work around this, have you?

Again, thanks for all the help.

from pyairtable.

 avatar commented on May 23, 2024

I believe I corrected myself, I restored everything back to normal.

Turns out the only weird issue I had was when I used the url_safe_table_name for authentication it returned a 404, but using the table_name allowed me to create the Airtable class.

Is there something wrong with this approach?

from pyairtable.

 avatar commented on May 23, 2024

When the table name includes characters such as % the safe_url changes the string slightly:

>>> airtable = Airtable("appipCCmuh5ixrmxX","Content%20production")
Traceback (most recent call last):
  File "<stdin'>", line 1, in <module>
  File "C:\Users\theom\AppData\Local\Programs\Python\Python37-32\lib\site-packages\airtable\airtable.py", line 131, in __init__
    self.is_authenticated = self.validate_session(self.url_table)
  File "C:\Users\theom\AppData\Local\Programs\Python\Python37-32\lib\site-packages\airtable\airtable.py", line 138, in validate_session
    raise ValueError('Invalid base or table name: {}'.format(url))
ValueError: Invalid base or table name: https://api.airtable.com/v0/appipCCmuh5ixrmxX/Content%2520production

image

Am I missing something very obvious? Perhaps using the appropriate escape character?

from pyairtable.

gtalarico avatar gtalarico commented on May 23, 2024

auto url escape was added by a contributor on #10
Did you try using the un-escaped version of the table name?

airtable = Airtable("appipCCmuh5ixrmxX","Content production")

should correctly result in the url below:

https://api.airtable.com/v0/appipCCmuh5ixrmxX/Content%20production

from pyairtable.

gtalarico avatar gtalarico commented on May 23, 2024

Not that I know of. I don't think thats exposed through the api

from pyairtable.

holdmypotion avatar holdmypotion commented on May 23, 2024

I had the same bug.
Thanks for the help gtalarico.

from pyairtable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.