You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am a little confused on how I go about getting key's.
Is this the token that will allow us to interact with sever?Are we just looking for the key type?
Help is appreciated.
-landon
On Saturday, December 27, 2014 2:03 PM, Jim Ciallella <[email protected]> wrote:
There is a new column in the spreadsheet. The immediate goal is to figure out what each organization's key value is and paste it into that column. You can see the real example I just filled out for UpstatePHP. You can start by filling in the other 2 or 3 organizations that have Eventbrite listed in the spreadsheet. Even if they have no active events, or old events like RestFest, you can still get the key.
Eventbrite's documentation doesn't say where to find the organization ID, but I just figured that's it from experience.
It will now show a "Response" and in there the first value that says "id" (below utc_offset) is the group_id. That's the value we want to add to our spreadsheet.
So, in this case, I got
"id": 14215742,
so I added 14215742 to the spreadsheet to indicate that is Code for Greenville's group_id
Drupal 8 is still a bit buggy and incomplete, so I spent about 3 hours trying to deal with Drupal 8 instability and 30 minutes to actually configure things and figure how to add an update a record. I actually had to reinstall Drupal, so the work I did last night setting up the Organization fields is gone, but that's only about 5-10 minutes of work.
Anyway, I was able to create (POST) a test organization with a Name (aka title) and a status (aka field_situation) and then update the title using a (PATCH).
This means I'll be able to programmatically POST all 35 organizations, so no need to type them in.
Viewing the Organization
Again, there's only two fields on the organization at the moment, but I'll add them soon.
The update command in REST is usually PUT, but Drupal is using PATCH instead because of technical reasons which are way over my head. So, GET, POST, PATCH, DELETE are the 4 commands that correspond to view, add, update, delete.
Note: Drupal 8 changed things and now requires a _format at the end of GET requests, which is stupid, as using an Accept: header is the better way to do such things for a REST API. Still,
Accept: application/json
PHP_AUTH_USER: rest-read-only
PHP_AUTH_PW: {ask allella and he will share}
and then just hit "Send".
Note, this screenshot shows another Chrome Plugin, not Postman, but the general idea is the same.
This should yield a 200 OK response, along with a JSON object response with organization and Drupal data, which is the machine parse-able version of the organization data. And, that's the point of this first step of the API.
Hey Jim,
I didn't read all of your e-mail but I will get to it Sunday and start seeing how I can participate.. Thanks so much for getting drupal and the REST api setup..-landon
On Friday, February 13, 2015 1:27 AM, Jim Ciallella <[email protected]> wrote:
Activity
allella commentedon Nov 3, 2014
Nothing yet on the Drupal side.
KCulture commentedon Dec 2, 2014
Does the group have an IRC channel or something?
allella commentedon Dec 27, 2014
@smoking-peanuts
Landon, I'm going to setup a Drupal 8 site and start playing with building a REST API with the organization data.
It would help if if you want to pick up on what we talked about in late Oct, https://github.com/codeforgreenville/UpstateEvents/wiki/Meeting-Notes-2014.10.28#next-steps and gather keys Evitebrite, Facebook, etc based on which site each organization uses to post their events.
KCulture commentedon Dec 31, 2014
Hey
I am a little confused on how I go about getting key's.
Is this the token that will allow us to interact with sever?Are we just looking for the key type?
Help is appreciated.
-landon
@smoking-peanuts
Landon, I'm going to setup a Drupal 8 site and start playing with building a REST API with the organization data.It would help if if you want to pick up on what we talked about in late Oct, https://github.com/codeforgreenville/UpstateEvents/wiki/Meeting-Notes-2014.10.28#next-steps and gather keys Evitebrite, Facebook, etc based on which site each organization uses to post their events.—
Reply to this email directly or view it on GitHub.
allella commentedon Dec 31, 2014
It depends on where each community posts their events.
For instance, UpstatePHP uses Eventbrite. So, if you find their organization profile on Eventbrite it has a URL of http://www.eventbrite.com/o/upstatephp-6881540935
Where the 6881540935 is the organization key that would be needed to search for events belonging to that org.
There is a new column in the spreadsheet. The immediate goal is to figure out what each organization's key value is and paste it into that column. You can see the real example I just filled out for UpstatePHP. You can start by filling in the other 2 or 3 organizations that have Eventbrite listed in the spreadsheet. Even if they have no active events, or old events like RestFest, you can still get the key.
Eventbrite's documentation doesn't say where to find the organization ID, but I just figured that's it from experience.
http://developer.eventbrite.com/doc/organizers/
and I confirmed it's correct by using the organization ID to get a list of events for UpstatePHP
http://developer.eventbrite.com/doc/organizers/organizer_list_events/
like
http://www.eventbrite.com/rss/organizer_list_events/6881540935
allella commentedon Dec 31, 2014
To determine the Meetup group's ID value you must log into Meetup and then go to their "console" tool for the group lookup functionality.
https://secure.meetup.com/meetup_api/console/?path=/2/groups
Then, you need to paste in a community's Meetup.com URL name into the group_urlname text box.
For example, Code for Greenville's Meetup.com page is http://www.meetup.com/Upstate-Code-for-America/
so, I pasted
Upstate-Code-for-America
into the group_urlname textbox and then hit Enter.
It will now show a "Response" and in there the first value that says "id" (below utc_offset) is the group_id. That's the value we want to add to our spreadsheet.
So, in this case, I got
"id": 14215742,
so I added 14215742 to the spreadsheet to indicate that is Code for Greenville's group_id
Meetup.com Group Documentation
http://www.meetup.com/meetup_api/docs/2/groups/
allella commentedon Dec 31, 2014
@smoking-peanuts We probably won't use RSS, but here are notes on it.
#16
KCulture commentedon Feb 10, 2015
@allella So how is the Rest API going.. anything that I can do to help?
allella commentedon Feb 11, 2015
@smoking-peanuts I got the basic schema setup in Drupal 8. I tried to import all 35 records, but the Feeds module has some bugs.
I'll see if I can import it in. If not then I may need a hand with data entry.
allella commentedon Feb 13, 2015
@smoking-peanuts The feeds module is "not stable". I'm going to try to create records using the REST API to see how that works.
https://www.drupal.org/node/2022803
allella commentedon Feb 13, 2015
@smoking-peanuts
Alright, the REST API is up and working.
Drupal 8 is still a bit buggy and incomplete, so I spent about 3 hours trying to deal with Drupal 8 instability and 30 minutes to actually configure things and figure how to add an update a record. I actually had to reinstall Drupal, so the work I did last night setting up the Organization fields is gone, but that's only about 5-10 minutes of work.
Anyway, I was able to create (POST) a test organization with a Name (aka title) and a status (aka field_situation) and then update the title using a (PATCH).
This means I'll be able to programmatically POST all 35 organizations, so no need to type them in.
Viewing the Organization
Again, there's only two fields on the organization at the moment, but I'll add them soon.
Here's the human readable web page.
https://data.openupstate.org/node/2
You'll need to install the Dev HTTP Client plugin for Chrome to see the REST response for the organization. I know that may not make sense, but if you go to the "Using the REST API" section of https://drupalize.me/blog/201401/introduction-restful-web-services-drupal-8 then he has screen shots and it's rather easy.
Other Notes
The update command in REST is usually PUT, but Drupal is using PATCH instead because of technical reasons which are way over my head. So, GET, POST, PATCH, DELETE are the 4 commands that correspond to view, add, update, delete.
It's currently necessary to use Content-Type: application/hal+json for POST and PATCH due to the issues I described here https://www.drupal.org/node/1964034#comment-9619331
allella commentedon Feb 13, 2015
Doing a Simple REST GET Method
So, once the Postman Client plugin is installed in Google Chrome](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en) you can just fill in the values shown in the screenshot. However, I'll have to give you the full username and password.
Request URL
https://data.openupstate.org/node/7?_format=json
OR, it's alias
https://data.openupstate.org/organization/code-for-greenville?_format=json
Note: Drupal 8 changed things and now requires a _format at the end of GET requests, which is stupid, as using an Accept: header is the better way to do such things for a REST API. Still,
Accept: application/json
PHP_AUTH_USER: rest-read-only
PHP_AUTH_PW: {ask allella and he will share}
and then just hit "Send".
Note, this screenshot shows another Chrome Plugin, not Postman, but the general idea is the same.

This should yield a 200 OK response, along with a JSON object response with organization and Drupal data, which is the machine parse-able version of the organization data. And, that's the point of this first step of the API.
Example of the data from a GET
KCulture commentedon Feb 13, 2015
Hey Jim,
I didn't read all of your e-mail but I will get to it Sunday and start seeing how I can participate.. Thanks so much for getting drupal and the REST api setup..-landon
Helpful Tutorials (Tuts) and Documentation
http://tntfoss-vivekvpandya.rhcloud.com/node/40
https://drupalize.me/blog/201401/introduction-restful-web-services-drupal-8
http://build2be.com/content/state-rest-headless-drupal-8
https://www.drupal.org/node/2098511
JSON Validation Tool
http://pro.jsonlint.com/
Jim Summarizing the State of Drupal 8 PATCH
https://www.drupal.org/node/1964034#comment-9619331—
Reply to this email directly or view it on GitHub.