Services

This is a discussion and working group for anyone interested in the Services module and related modules. This module was created out of a need for a standardized solution of integrating external applications with Drupal, specifically Flash and Flex applications. Visit the issues page for all bug reports. Also visit the Services Handbook for information and examples.

Abstracted Web Services API for Drupal 7

Rob Loach's picture
public
Rob Loach - Thu, 2008-03-06 06:41

This is the beginnings of a design specification proposal for an abstracted API for implementing web services within Drupal 7. This allows Drupal to act as both a server and client for web services in any protocol medium (XML-RPC, RDF, RSS, JSON, etc). It is the combined efforts from a number of people at Druplicon including Marc Ingram, Scott Nelson, Nedjo Rogers, Dmitri Gaskin, etc.

Services API


Using SOAP with Drupal

public
group: Services
kellabyte - Thu, 2008-07-03 16:45

Hiya.

I am new to Drupal so please bare with my ignorance ;)
We are evaluating CMS's out there and usually in the enterprise world what makes or brakes you is the due diligence that has been done on integration APIs.

We have looked at various other CMS's and it seems like Drupal is beginning to take being a "content management service" more serious than other alternatives who are happy to just be a website with open sourced code and "integrate however you wish" philosophy.

I am really glad to see this initiative.

How to use Flash 9 (CS3) with Services and AMFPHP

public
group: Services
artfo - Wed, 2008-07-02 14:44

I've seen a number of Flex/Drupal tutorials, but very few Flash/Drupal tutorials. There is one here:
http://modern-carpentry.com/talk/?p=32

But it misses out any of the newbie stages, i'm just about getting around OOP and am pretty new to AS3, so i'd love some .fla example files, or a real step by step tutorial. Does anyone know of a really simple tutorial to get me started.

My goal is to initially make a simple flash website that can access drupal, but i'm stumbling at the first hurdle - can anyone offer a pointer?

call drupal function from external php file

public
group: Services
mirian@drupal.org - Wed, 2008-06-25 09:18

Hi all,

I'v just heard about this module and understood it might help me...
I want to get values from external php script which will call drupal function that will take the data and call "node_save" with new node that contain the relevant data (which was arrived from the external php)

I don't understand how services can solve it.

Thanks,
Miriam.

Services Newbie Question

dewolfe001's picture
public
group: Services
dewolfe001 - Wed, 2008-06-25 04:40

I've been trying to build two modules that will talk to each when installed on separate sites. The functions appear to work in unit testing, but they do not talk to each other. I am not sure what I'm doing wrong. I made up a hook_xmlrpc and a hook_service function to see if that was the difference, but no luck there.

Function on calling site and the function that "should" be calling the remote site:

// basically the cron job-- the tool that updates the links and spiders for new entries
function plrhub_update_index($site_id = -1) {
if ($site_id == -1) {


drupal 5, as2 node.save how to set uid and url alias

public
group: Services
mhncsa - Fri, 2008-06-20 08:35

Hi Everybody!
I'm new to drupal. I would like to make a website with a flash based interview appz. After user click send button I'd like to store the interview text as a node. I used the example "Accessing a service from Flash 8". It works fine.
I have made some changes in the flash code, because I don't want to load the node to the flash but I want to save the flash content to database as node:
var content = new Object();
content.type = "interview";
content.title = "some title";
content.body = "some body text";
var pc:PendingCall = node.save(content);

Services Security Update -- Please Update your Version of Services.module

bmcmurray@drupal.org's picture
public
group: Services
bmcmurray@drupal.org - Thu, 2008-06-19 14:16

For those who don't get the Security email announcements:

------------SA-2008-038 - SERVICES - ARBITRARY CODE EXECUTION------------

 * Advisory ID: DRUPAL-SA-2008-038

 * Project: Services (third-party module)

 * Versions: 5.x and 6.x

 * Date: 2008-June-18

 * Security risk: Highly critical

 * Exploitable from: Remote

 * Vulnerability: Arbitrary code execution

------------DESCRIPTION------------

The Services module package was created out of a need for a standardized
solution to integrate external applications with Drupal. It builds on concepts
from Drupal core's XMLRPC interface, but abstracts service callbacks so that
they may be used with multiple interfaces such as XMLRPC, SOAP, REST, and AMF.
This enables a Drupal site to provide web services via multiple interfaces while
using the same callback code.

Unfortunately, the access control system is not sufficiently granular; Users
with access to use a services have access to all provided services. With the
provided node services, or the system services enabled, it allowed arbitrary
code execution for those users.

Access to services can optionally be limited to certain ip addresses or
configured to need an API key, somewhat mitigating the issue.

------------VERSIONS AFFECTED------------

 * Versions of Services for Drupal 5.x prior to 5.x-0.9

 * Versions of Services for Drupal 6.x prior to 6.x-0.9

If you do not use the Services module, there is nothing you need to do.

------------SOLUTION------------

Install the latest version:

 * If you use Services for Drupal 5.x upgrade to Services 5.x-0.9 [
http://drupal.org/node/272203 ]

 * If you use Services for Drupal 6.x upgrade to Services 6.x-0.9 [
http://drupal.org/node/272202 ]

Review the new security features within the module, and upgrade all of your
remote service calls to authenticate a user session ID before making any Service
calls requiring secure communication.

See also the Services project page [ http://drupal.org/project/services ].

------------REPORTED BY------------

Scott Nelson [ http://drupal.org/user/31156 ], Gerhard Killesreiter [
http://drupal.org/user/227 ], Heine Deelstra [ http://drupal.org/user/17943 ].

------------CONTACT------------

The security contact for Drupal can be reached at security at drupal.org or via
the form at [ http://drupal.org/contact ].

How to pass API key to xmlrpc server for node.load function from client for pulling data from the server ?

public
group: Services
baruah - Thu, 2008-06-19 13:04

I am trying to pull node from the remote site that contains service module(xmlrpc server), if i dont use the API key then i can extract the node using the following code from client drupal installation.

$node = xmlrpc('http://remotesitename/services/xmlrpc', 'node.load', 12, array());

But if i want to use the API key then how can i extract/pull node from the remote site so that only valid users can avail the service of service module.

Thanks in advance.

User Servce: Registration call missing?

MattVBO's picture
public
group: Services
MattVBO - Tue, 2008-06-17 14:25

We're happily building a flex site with Drupal as our content and membership provider. Everything works great, except today when I'm getting ready to put the registration side of things on the Flex application - I cannot find a way to call into Druapl to register a user.

The login/logout service calls work perfectly - as does the connect call from the system service - but I am at a loss as to what call to make to register a new user.

Any direction greatly appreciated.

M@


AS3 - AMFPHP connection problems

public
group: Services
gpdinoz@drupal.org - Mon, 2008-06-16 12:57

Hi all,

I have been playing around with AS3 and AMFPHP using FlashDevelop IDE and slowly learning. I have pieced the following code together and finally having overcome all the syntax errors and getting the types properly defined It doesn't throw any compiling error however it won't connect.

I get the following error

Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.Failed at drupal2()

If someone could point out my probably obvious mistake I would be very appreciative.


package {

import flash.display.Sprite;

Creating Images in Flash>Saving to Server>Creating Nodes

elliotttt's picture
public
group: Services
elliotttt - Sat, 2008-06-14 16:12

Hey everyone, I thought I'd post about a project I'm working on. My goal was to have a user create images in Flash, and ultimately have Drupal save the image on the webserver along with node data for retrieval later.

It works!

I'm new to using Services and AMFPHP, and to some extent Actionscript 3, but with the screencasts Rob Loach provided (HUGE thanks!!) I was able to start wrapping my head around this stuff. Even though the tutorials are done in Flex, with some fiddling I got it to work in Flash CS3.


amfphp - using the api key in Flash 8

public
group: Services
timosea - Thu, 2008-06-12 13:40

ello, i'm new to this group and to the service / amfphp modules. after following the flash 8 section in the services hand handbook [http://drupal.org/node/140893 ] i've got my flash site to connected to drupal, so a well happy. but i'm struggling to find out how to implement the api and session keys in as2; the as3 stuff seem really cool, but my site need run in as2. Could anyone point me in the right direction of any as2 classes or help with some basic syntax, where do i add the api and session keys?

Reverse engineer a Flash/AMFPHP view

public
group: Services
wishbone - Tue, 2008-06-10 04:12

I hope this is the appropriate place for this question. I have searched around but cannot find an answer. Hopefully someone here can help:

I am building a Flash/AMFPHP/Drupal site. I populate the Flash from Views.
I had a working view into Flash but somehow screwed it up (don't ask!)...

Background info:
I have created a Custom Content Type called "music" using the CCK audio_field.
I have a view that collects all nodes of this type.

In Flash I push the "Titles" and the "Bodies" into two arrays using this:

private function getMP3s(result:Object):void
{

Nodepoints and Userpoints...

heinzmilitar's picture
public
heinzmilitar - Mon, 2008-06-09 05:37

I've created a new module...am still waiting for Drupal.org to accept it...

Nodepoint is the same with userpoint module, but this module allows nodes to have points...

The pratical use of this is when a user gets a service on a certain node his userpoint will be deducted based on the nodepoints of the node...

let me know your toughts pinoys... Im working on new customized modules for BMF (Cebu-based)...
Next i will create its nodepoint services (XMLRPC or JSON servers). Any body got an idea on this?


Flex and Services security

ebeyrent's picture
public
group: Services
ebeyrent - Fri, 2008-05-16 13:42

I'm using Flex to build cross-domain widgets that can be embedded on any domain. These widgets consume data via Services and AMFPHP. Unfortunately, I've been notified that my site is now vulnerable to attacks because I have a liberal crossdomain.xml policy file that allows connections from any domain.


Does an RSS Aggregator Service exist?

MattVBO's picture
public
group: Services
MattVBO - Tue, 2008-05-06 16:58

I'm very happy with the way the Drupal Aggregator Module allows a user to build a collection of news feeds.

We would like to display the same information it outputs via a flex application, and I'm having a hard time deciding the best way to do this. We're serving up other content from Drupal to Flex via the services module. There doesn't appear to be a direct service for the data the aggregator displays.

I did find in beta5 of the Services module the ability to create a RSS view - but this appears to be only a single feed, unless I'm missing something.


Retrieving Drupal user session from Flex3

public
group: Services
redluk - Sat, 2008-05-03 12:18

I've been having an issue for a week now.

I have a tiny Flex 3 app which simply retrieves the current drupal user session and displays the user data.
I'm using D6, services, amfphp with sessid turned off.

When I run the app on my laptop, the system.connect() method returns the proper Drupal user/session. If I switch user in Drupal and refresh the app I get updated and accurate user data displayed. My Sessions table only shows one Drupal session and my Flex app uses that session correctly. Seems smooth enough.

My problem is when other users access the app. Two scenarios here:

Blocks and service calls

BeechyBoy's picture
public
group: Services
BeechyBoy - Sun, 2008-04-27 16:50

It seems that node specific data (nid, title) isn't getting passed into a block I have that contains a SWF looking to call a "views.getView" service. The view contains an argument that looks for a node ID and shows only that nodes info.
I've got a custom page layout in Panels2. One of the panels holds this service calling SWF. It seems that the block or SWF itself isn't registering an nid, where as other views and pieces of content in the same panel do?
Is there a snippet or workaround to pass the data needed into blocks for the service call to use?


OAuth Integation with ServicesAPI

sumit_kataria's picture
public
sumit_kataria - Tue, 2008-04-22 13:09

Project information


Views versions

public
group: Services
heyrocker - Tue, 2008-04-15 14:38

While reading #245747, I realized that the Views import/export service I wrote was only tested with Views 1, I have no idea if it works with Views 2 (although it seems doubtful). It also seems likely that the other Views services will be broken in Views 2. Anyone have any ideas what to do about this situation, if anything? Include a views_1_service and a views_2_service? It would be great if we could talk Earl into working the services into Views itself, although certainly he has enough to worry about right now.

How to use this modules

public
group: Services
ziobudda - Tue, 2008-04-08 11:36

Sorry for this very very very stupid questions, but how can I contact a drupal-services from another drupal-site ?

I have read the documentation, see the source of services.module and *_service.module, but I have not understand how can I call this module from another site or via web browser (javascript/json service module).

Please help this newbie.

M.

How to get this working with custom services?

BeechyBoy's picture
public
group: Services
BeechyBoy - Sun, 2008-04-06 00:03

I followed the Flash8 tutorial and wanted to get the SWF I outputted originally calling the node.load service to pick up the custom recipes service instead. Below is my stab at it, but it's not working. How would I access a custom service, or take this Flash example further?


Bring services and rules together

fago@drupal.org's picture
public
groups: Rules · Services
fago@drupal.org - Wed, 2008-04-02 09:04

I think it would be really useful to do a rules engine integration, so one can do service calls by configuring rules (per UI). It looks like one has already to specify the arguments for a service - so we would have to convert this to the format of the rules API and expose an action per service. Basically that should do it already.

Have I forgotten something? What do you think about this idea?


Voting API service

detour's picture
public
group: Services
detour - Tue, 2008-04-01 19:54

I just uploaded a stand-alone module that provides Services methods for the Voting API. This allows external applications to access and modify Voting API data for Drupal objects. For example, a Flash application could implement an interface for voting on nodes.

I've submitted this as a feature request to the Voting API project at:
http://drupal.org/node/241453

If you use the Voting API and Services, please help me test this and support its inclusion in future Voting API releases. Let me know if you have any questions or suggestions.


Adobe AIR for Linux

ccharlton's picture
public
ccharlton - Mon, 2008-03-31 17:26

GSoC-08:Secure OAuth Services

Rob Loach's picture
public
Rob Loach - Sat, 2008-03-29 19:29

This is a Google Summer of Code project proposal by Sumit Kataria.


OAuth and Security

Rob Loach's picture
public
group: Services
Rob Loach - Wed, 2008-03-26 05:16

One issue with the Services API is its weak implementation of API keys. Although it does work, it could be better. It is probably worth it to investigate OAuth, an open protocol to "allow secure API authentication in a simple and standard method from desktop and web applications". Some of you got the chance to see Boris' talk on this in Boston at Drupalcon, any thoughts? How would it effect Services?


JSON Server and Facebook

ebeyrent's picture
public
group: Services
ebeyrent - Wed, 2008-03-19 18:36

I am currently using Flex to consume an amfphp service, and it works great. However, when you try to use the swf on a Facebook profile, you have to click on an image first in order to load the swf.

My thought was to use the JSON server to return JSON to my facebook app. However, I get hit with the cross domain security issue. Has anyone here successfully accessed the JSON Server from a remote domain?

-Erich-


Organic groups..?

napoly's picture
public
group: Services
napoly - Mon, 2008-03-10 23:22

Hello.. I'm working on my little app here.. have figured out login, upload avatar.. and so on.. http://metroklub.sk/drulog/bin-release/DrupalLoginApp.html <-- don't know how long it will hang there.. anyway I would like my users to create their own group and let others to join in if they are approved.. nothing really complicated [i guess] but now I don't know which direction to take.. should I role out my own piece of php code with included bootstrap.. or install an organic groups module and try to make a service for it?.. [I don't think I'm skilled enough to write my own services]..


Format of the node object in the node.save method form (in services admin interface)

public
group: Services
geraud - Mon, 2008-03-10 12:31

I would like to test the node.save method of the "node" service in the browser of the "services" admin interface.
(/admin/build/services/browse/node.save)

In order to do that, I have to provide the form with an object that will be added to Drupal (if everything works correctly).

But I can't figure out what the format of this node-object should be (array, json,...). What is the syntax ?

Any help would be appreciated.

Cheers

Taxonomies/Categories

public
group: Services
rodmc - Tue, 2008-03-04 16:18

Hi I am new to Drupal services, how do make sure an article is posted to the correct categories/taxonomies. I can create new articles via Services without any problem but assigning them to categories is proving a little harder. If it makes any difference I am using the services module with Python.

Thanks in advance.

rod

Web Services in Drupal 7

Rob Loach's picture
public
Rob Loach - Wed, 2008-02-27 00:34

Just a quick note that nedjo posted a note about Services module going into core. This would allow use of XML-RPC, JSON, RSS, REST, SOAP and more to be loaded through a common Services API.

A Code Sprint will take place in Boston this coming Friday that will focus on the inclusion of this new Services API.


Are you interested in learning or using Flex?

ccharlton's picture
public
ccharlton - Mon, 2008-02-25 19:41
Yes
56% (73 votes)
Maybe
12% (16 votes)
No
18% (24 votes)
Not sure yet
14% (18 votes)
Total votes: 131

Newbie question

public
group: Services
DaKawa1 - Tue, 2008-02-19 17:05

Hi guys

I'm new to drupal and want to start writing my own services.

It all works fine for stuff like node.load and other related services. Now I want to try and create some sort of node.save, but if I visit the node.save page in the Adminster / Services / node.save page, it asks me to enter the following node argument

Arguments (1)

struct node (required)
A node object. Upon creation, node object must include "type". Upon update, node object must include "nid" and "changed".

Does anyony know what the format is that I should use?

I tried several formats like this

Better Drupal Interaction Design with Flex session at Drupalcon Boston 2008

ccharlton's picture
public
ccharlton - Tue, 2008-02-19 03:28

I just got notice that my Better Drupal Interaction Design with Flex session for Drupalcon Boston 2008 was accepted and is being scheduled. I don't know what day it will be on yet, but it should be on Monday or Tuesday since those are the days I'll be at Drupalcon. Here are the points I'll be covering in my time alloted:

  • Differences between HTML & Flex
  • Differences between Flex & Flash
  • What makes an RIA (Rich Internet Application)?

Upload files to drupal via web service (from flex/air client)

public
group: Services
ismcdonald@drup... - Sat, 2008-02-16 16:08

Hi All,

(Apologies for cross posting - I've put this at http://drupal.org/node/222404 before I realised this might be a better place for it.)

I'm looking for a way to upload fiiles to a drupal site via a web service (from a AIR/ flex application actually) and I after some digging, I don't see anything on the forums or in the contributed modules that addresses this, so I though I'd post before we go ahead and develop a module to do this.

The module would, very simply:

Proposed Web Service Clients module: Preparing the way for external fields

public
nedjo - Wed, 2008-02-13 20:02

At the recent Data Architecture Design Sprint, participants outlined a development path in which fields can be local or external. A given entity instance (node, user, etc.) can be fully local, fully external, or a combination of the two. For example, a node can have several fields stored and handled in a local SQL database and other fields both loaded from and written to an external SOAP service.

Search service

detour's picture
public
group: Services
detour - Fri, 2008-02-08 00:13

I've developed an additional service to implement Drupal content searching. This service provides one method, search.searchData, which uses Drupal's hook_search (and is closely based on the Drupal API command search_data).

The service accepts up to three arguments:

  1. search_keys: the keywords for the search
  2. type (optional): the type of data to search (i.e. 'node', 'user')
  3. simple (optional): if set, the search returns only the main fields (link, type, title, user, date, snippet) and removes any additional data

HowTo: Contribute Services Code

tourguide@drupal.org's picture
public
tourguide@drupal.org - Sun, 2008-02-03 00:26

What is the best way to organize and commit patches back to Drupal modules for Services?

Examples:
* comment.load
* comment.user
* inbox.getmessages
* node.load
* node.save
* node.delete
* user.login
* user.logout
* aggregator.load

User g10 starts the discussion with there should be a consensus bout this:


Drupal login from Flash/Flex

public
group: Services
wishbone - Sat, 2008-02-02 17:11

Any docs out there (or example) of logins from Flash to Drupal?
Has this been done before?
Any help is appreciated.

How does a service app create a session?

public
group: Services
cspwcspw - Sat, 2008-02-02 09:53

In Drupal 5: My C# application can access my drupal service al. la. Rob's great video. I turn on the session ids for the service, and call the system.connect service to get a sessionID, which I then pass around as the extra parameter in each of my service calls. I authenticate my user, but cannot persist the session state...

How to call drupal web service from SQL Server 2005

public
group: Services
mpenaili - Wed, 2008-01-30 18:59

Hi.

How to Consume a drupal xmlrpc web service from SQL Server 2005 Stored Procedure?

Thank's
Marcelo P.

DrupalCon 2008 and Services

snelson's picture
public
group: Services
snelson - Wed, 2008-01-23 08:53

Hello all,

I will be attending my first DrupalCon at Boston and am working to organize and propose a session about Services. I'm thinking of doing a short presentation about my original vision for Services, and then an open discussion on Drupal and web services in general, expanding on some of the great ideas posted over the last few months.

I'd like to know if there's anything in particular you think the session should cover, and also to connect with anybody who might be thinking of doing a Services related session, or would like to get involved.

Thanks,
Scott


I need help with this code

miolas's picture
public
group: Services
miolas - Wed, 2008-01-16 18:56

I've a created a service that creates a simple Array. Here is the code, modified for debug:

/**
* Returns a bla bla bla.
*/
function node_tree_load($vid, $month) {
global $user;
$list = array();
$sql = "select tid,name
from {term_data}
where vid = '$vid'";
$result = db_query($sql);
while($data = db_fetch_object($result)){
$list[] = $data->name;
$nsql = "select n.nid
from {node} as n,{term_node} as tn
where tn.tid = $data->tid
and tn.nid = n.nid


Services for Drupal 6

Rob Loach's picture
public
group: Services
Rob Loach - Thu, 2008-01-10 04:50

The Services module for Drupal was created to provide a standardized way of supporting communication with external applications and Drupal. XML-RPC, JSON, AMFPHP and REST are just some examples of protocols that can be used as communication mediums. It's a great module which adds a lot of flexibility to Drupal, and it has just been ported to Drupal 6 with a Drupal 6 development branch.

Thanks, Scott Nelson and Marc Ingram for the help in putting this together.


New Drupal/AMFPHP/Flex site

public
group: Services
wishbone - Sat, 2008-01-05 17:03

Some history: I developed a Plone CMS/XML/Flash app a year ago for a university and have had problems with speed, XML filesize and scalability (for rather obvious reasons). Now I have a contract for a MAJOR music/film entertainer and want similar functionality with increased speed and use of AMF. I started yesterday with custom php/mySQL and Flash Remoting and then found this group. :-)

REST Server

Rob Loach's picture
public
Rob Loach - Sat, 2008-01-05 06:35

A REST Server is now available for the Services module, so that external REST clients can communicate with Drupal Services. In order to use the REST Server, you have to install the Zend Framework.

http://drupal.org/project/rest_server


Lesson #38: Drupal and the Desktop

Rob Loach's picture
public
Rob Loach - Fri, 2008-01-04 02:45
Start: 
2008-01-05 11:00 Canada/Eastern - 2008-01-05 13:00 Canada/Eastern

Drupal is a powerful web application platform, we all know that. But what happens when we want to use it from the desktop in a software application? Join the world of Drupal web services in this lesson, covering how to break down the bridge between the desktop and Drupal through Services and Mono/.NET.


The Zend Framework Module

Rob Loach's picture
public
Rob Loach - Fri, 2007-12-28 07:57

The Zend Framework Module for Drupal ensures that the Zend Framework is installed properly and ready for use. It lists the Zend Framework version number in the server status page, let's the administrator change Zend's installation directory, as well as provide a nice API feature set to make the Zend Framework's functionality easily accessible to other modules. One of these API benefits is the zend_initialize($class) function that cleanly includes a class from the Zend Framework and make it ready for use.

This could lead to some very powerful Service modules that use the powerful web service platform.


phpbb3

public
group: Services
krisbfunk - Fri, 2007-12-28 05:19

has anyone here attempted to use the Services Module to show phpBB3 within a drupal page? (post drupal5/phpbb3 integration)

it's explained here for phpbb2, but i'm not sure how to do the same thing with phpbb3.. just wondering if anyone has attempted it, or is willing to lead me in the right direction to do this with phpbb3..

http://drupal.org/node/44977#comment-265968

Syndicate content