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

Can't create an event #15

Closed
pydanny opened this issue Jan 30, 2015 · 2 comments
Closed

Can't create an event #15

pydanny opened this issue Jan 30, 2015 · 2 comments

Comments

@pydanny
Copy link
Contributor

pydanny commented Jan 30, 2015

@egradman reported this error:

from eventbrite import Eventbrite

EB_AUTH_TOKEN = "XXXXX"
eventbrite = Eventbrite(EB_AUTH_TOKEN)

user = eventbrite.get_user()  # Not passing an argument returns yourself
print user # <-- this works

event_dict = {
  'name': {
    'html': '2bc test event',
  },
  'organizer_id': 'XXXXXXXX',
  'start': {
    'utc': '2015-03-07T20:00:00Z',
    'timezone': 'America/Los_Angeles',
  },
  'end': {
    'utc': '2015-03-07T23:00:00Z',
    'timezone': 'America/Los_Angeles',
  },
  'currency': 'USD',
  'venue_id': '9053805',
  'online_event': False,
  'listed': False,
  'category_id': '110',
  'format_id': '5',
  'password': "test",
  'capacity': 10,
  #'description': {
  #  'html': 'html description',
  #},
}
print eventbrite.post("/events/", data=event_dict)```

Notes:

* `/events/` is not defined in the JSON URL mapping.
* Replace `XXXXXX` with the appropriate values.
@pydanny
Copy link
Contributor Author

pydanny commented Jan 31, 2015

@egradman, here is an example of how to create an Event via the SDK: https://github.com/eventbrite/eventbrite-sdk-python/blob/master/tests/integration/test_events.py#L32-L62.

We'll be fine-tuning this in the next few weeks, including documentation for this specific task. 😄

@egradman
Copy link

from eventbrite import Eventbrite
import datetime

eb_oauth_token = “XXX"
eventbrite = Eventbrite(eb_oauth_token)

user = eventbrite.get_user()  # Not passing an argument returns yourself
print user # <-- this works

event_name = 'client_test_{0}'.format(datetime.datetime.now())
print event_name
event_data = {
  'event.name': {
    'html': event_name,
  },
  'event.start': {
    'utc': '2015-03-07T20:00:00Z',
    'timezone': 'America/Los_Angeles',
  },
  'event.end': {
    'utc': '2015-03-07T23:00:00Z',
    'timezone': 'America/Los_Angeles',
  },
  'event.currency': 'USD',
  'event.online_event': True,
  'event.listed': False,
  'event.category_id': '110',
  'event.format_id': '5',
  'event.password': "test",
  'event.capacity': 10,
}
event = eventbrite.post('/events/', data=event_data)
print event

Copied (mostly) from https://github.com/eventbrite/eventbrite-sdk-python/blob/master/tests/integration/test_events.py#L32-L62

Still yields a 500 error.

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

2 participants