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

ResourceNotFound error #44

Closed
skunkwerk opened this issue Oct 16, 2014 · 10 comments
Closed

ResourceNotFound error #44

skunkwerk opened this issue Oct 16, 2014 · 10 comments

Comments

@skunkwerk
Copy link

Hi John,

thanks for putting together this library for our use.
Do you know what this error means? I try the same call from my console, and I don't get any error - so I'm not sure what's causing this.

File "/src/index.py", line 399, in send_event_to_intercom
impression = Event.create(event_name=event, user_id=customer_id, metadata=properties)
File "intercom/events.py", line 17, in create
resp = Intercom.create_event(event_name=event_name, user_id=user_id, email=email, metadata=metadata)
File "intercom/intercom.py", line 463, in create_event
'POST', Intercom.api_endpoint + 'events', params=params)
File "intercom/intercom.py", line 66, in wrapper
raise_errors_on_failure(response)
File "intercom/intercom.py", line 76, in raise_errors_on_failure
raise ResourceNotFound("Not found.")

@snario
Copy link

snario commented Jan 10, 2015

👍

@jkeyes
Copy link
Contributor

jkeyes commented Mar 20, 2015

@skunkwerk @snario Have you tried this with the latest code on the apiv2 branch? (Sorry for being so very late in replying)

@jkeyes
Copy link
Contributor

jkeyes commented Mar 29, 2015

@skunkwerk @snario Version 2.0.alpha has been released: https://pypi.python.org/pypi/python-intercom/2.0.alpha Let me know if you still encounter the problem.

@jkeyes jkeyes closed this as completed Mar 29, 2015
@greenafrican
Copy link

Hi @jkeyes I'm using the newly merged master and am receiving this error.

@jkeyes
Copy link
Contributor

jkeyes commented Mar 30, 2015

Hey @greenafrican. Please include some example code that reproduces the problem, and I'll take a look.

@greenafrican
Copy link

Pretty basic:

pip install python-intercom==2.0.alpha

from intercom import Intercom
Intercom.app_id = 'xxx'
Intercom.app_api_key = 'xxx'
from intercom import User
user = User.find(email="bob@example.com")

...    
     69     def raise_errors_on_failure(cls, resp):
     70         if resp.status_code == 404:
---> 71             raise errors.ResourceNotFound('Resource Not Found')
     72         elif resp.status_code == 401:
     73             raise errors.AuthenticationError('Unauthorized')

ResourceNotFound: Resource Not Found```

@jkeyes
Copy link
Contributor

jkeyes commented Mar 30, 2015

@greenafrican If bob@example.com isn't a user in your app then that error is expected.

@greenafrican
Copy link

A 404? Usually expect that with broken links. Oops. I expected the response to still be successful but empty or null. Thanks

@jkeyes
Copy link
Contributor

jkeyes commented Mar 30, 2015

Yeah. The 404 status code indicates that what was requested could not be found. In the case of this call what is being requested is an application/json representation of a User.

See the API docs for the full list of HTTP status codes returned by the API: https://doc.intercom.io/api/#http-responses

@greenafrican
Copy link

Ok cool. I thought resource was referring to the server. Perhaps change the example to:

user = User.create(email="bob@example.com", name="Bob Smith")
user = User.find(email="bob@example.com")

;)

Thanks for the stellar work!

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

4 participants