Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"thread:ident=some_id" like params, validation failed #4

Open
beholderrk opened this issue Jun 10, 2011 · 6 comments
Open

"thread:ident=some_id" like params, validation failed #4

beholderrk opened this issue Jun 10, 2011 · 6 comments

Comments

@beholderrk
Copy link

code like this not working now:

disqus.threads.details(forum=settings.DISQUS_WEBSITE_SHORTNAME, **{'thread:ident': 'some_id'})

because thread:ident don't passed validation in call method of Resource class:

if not kwargs.get(k):
    raise ValueError('Missing required argument: %s' % k)

I replaced this code by:

if k not in [ x.split(':')[0] for x in kwargs.keys() ]:
    raise ValueError('Missing required argument: %s' % k)

https://github.com/disqus/disqus-python/blob/master/disqusapi/__init__.py#L120

@thetylerhayes
Copy link

Another way to fix this in the meantime would be to pass :ident in the value instead of the parameter name.

disqus.threads.details(forum=settings.DISQUS_SHORTNAME, **{'thread': 'ident:some_id'})

Or if you were assembling more dynamically:

disqus.threads.details(forum=settings.DISQUS_SHORTNAME, thread='ident:%s' % page.get_our_identifier())

@bartTC
Copy link

bartTC commented Sep 24, 2013

👍 This was very useful, thanks.

@alanjds
Copy link

alanjds commented May 27, 2014

Before opening another bug, let me ask: where do this thread:ident or ident:some_id is documented?

@dmatt
Copy link

dmatt commented May 27, 2014

@alanjds The threads/details endpoint is documented here https://disqus.com/api/docs/threads/details/

@alanjds
Copy link

alanjds commented May 28, 2014

GET thread:ident=my-identifier&forum=bobross

Oh, right... got it.

I just wish they to had been more explicit than You may pass us the 'ident' or 'link' query types instead of an ID by including 'forum'.

Would had saved me an afternoon.

Thanks @dmatt

@ohadschn
Copy link

ohadschn commented Jan 2, 2018

IMHO the docs are still not clear.

  • Nowhere does it explicitly say that ident must correspond to one of the values of identifiers in the https://disqus.com/api/docs/threads/details/ response.
  • Clarifying the link: syntax would be great too.
  • More generally, adding some sample requests to the API docs would improve things dramatically (other APIs even have interactive query builders and samples).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants