-
Notifications
You must be signed in to change notification settings - Fork 3
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
Drupal and REST #15
Comments
Nothing yet on the Drupal side. |
Does the group have an IRC channel or something? |
@smoking-peanuts 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. |
Hey I am a little confused on how I go about getting key's.
@smoking-peanuts |
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 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/ |
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. 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/ 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 Meetup.com Group Documentation |
@smoking-peanuts We probably won't use RSS, but here are notes on it. |
@allella So how is the Rest API going.. anything that I can do to help? |
@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. |
@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. |
@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 OrganizationAgain, there's only two fields on the organization at the moment, but I'll add them soon. Here's the human readable web page. 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 NotesThe 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 |
Doing a Simple REST GET MethodSo, 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 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, PHP_AUTH_USER: rest-read-only 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
|
Hey Jim,
Helpful Tutorials (Tuts) and Documentation |
Wanted to know how Drupal setup was going?
The text was updated successfully, but these errors were encountered: