Sport Ngin User Group Forum
SportsEngine Community Forum
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
molofson

Junior Member
Registered:
Posts: 5
 #1 
I'm trying to update a calendar event with multiple tags (page_node_ids), by replacing only one of the tags. Obviously when I PUT the updated event, all prior page_node_ids are replaced.

I don't see a facility in the event API set to fetch a list of page_node_ids associated with a given event id to manipulate a corrected array of page_node_ids?

I would expect it in this API?
http://developer.sportsengine.com/docs/events-show

content_node_id, the only "node_id"-related event attribute, is always NULL.

The sportngin app has this append functionality. How is it performed?

Thanks,

Mike


0
Coach Carl

Junior Member
Registered:
Posts: 9
 #2 
Mike,

I have not used this API, but I believe it works a little like teams and rosters.

I find that starting with the flow works for me:

http://developer.sportsengine.com/v1/page/managing-events-and-games

On events i think the tricky part will be scope for the page_node_ids if you wish to manipulate the list of page_node_ids (tags). You may have to do multiple queries to get information for those pages in the list of page_node_ids so that you can present the options to the user for add's or changes.

That said, everything is not documented to a super level of detail so for the teams / rosters I basically tested each query (Index and Show), to get JSON output, and then (in the case of teams) would make multiple queries to build up my dataset before I could give the users a choice and eventually use the Create/Update API's to finalize the changes.

I'm not sure if that will help, but I'll be interested in how you approach it as I'm looking for ways to incorporate event add / update to my suite of iOS apps (Big Time Coach on iTunes) next season.

-C

0
molofson

Junior Member
Registered:
Posts: 5
 #3 
Thanks Carl!


Had I read more fine print, I would have seen:

"An Event belongs to a Content Node, and can have a Game, a Dib Item, or a Survey."
and "Content Nodes are not directly accessible through the API."....

I will continue to hunt through APIs to possibly derive existing page_node_ids to generate a full list on event update, but for now--I will design around the problem [wink]

Thanks for your quick response.

Mike
0
molofson

Junior Member
Registered:
Posts: 5
 #4 
> multiple queries to get information for those pages in the list of page_node_ids.

Yes. Took me a second. This is it.
0
Coach Carl

Junior Member
Registered:
Posts: 9
 #5 
Awesome - Glad I could help!

I may be adding event integration to my iOS apps next year so I'll be interested in what things you run into as you build your API interactions.

Be aware that you'll need to code around the status code returned in the httpResponse.

If everything goes well you'll get a "200" status code and can process the JSON (get or push), if not you'll get other codes in the 400 range. I was testing yesterday and the API was responding with a "403" that indicated the request was not authorized. No errors in the response, just the 403 and an unauthorized message in the data package. In essence the service was down for a short time and then came back in time.

I've coded around these now and am letting my users know that the service is not available at the moment so they will need to try again later.

Just wanted you to be aware that there can be conditions where you've validated the token, but have API's that are temporarily responding with something other than 200.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Powered by Website Toolbox - Create a Website Forum Hosting, Guestbook Hosting, or Website Chat Room for your website.