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.

texas-bronius's picture

Services REST Server: Handling custom headers from within Simpletest

My REST server endpoint is an API that requires a security token be included in a custom header. In my callback (or access callback or anywhere) I can check for this custom header value against getallheaders():

Read more
texas-bronius's picture

Services REST server: Best practices for DRY when implementing custom endpoint for a custom model

I've implemented Services just a few times now from out of the box Drupal function to custom endpoints, and the current one is my most ambitious (and most meticulous) effort. I want to build it in the way that makes the most sense, and I feel informed enough now to have a decent discussion about best practices.

For a REST server hosted by the Services module, the request flow looks like this, right?

Read more
Sherif Darwish's picture

Drupal services as backend for mobile application

Hi,
I am developing ionic mobile application and i am using drupal as my backend for authentication & content creation.

It is all working great, however; I am now integrating facebook & twitter login to my app which will login the user using his facebook or twitter account.

My question is, how do i authenticate the same user to my drupal back-end using services so i can deal with this user as normal registered drupal user.

I was going to call the service register then login APIs after successful facebook login then i realized i need to double check if the same user register before

Read more
spuppett's picture

How can I pass an argument containing periods using Services?

Is there a way to have arguments passed in the path that contain periods? I have product ids that contain periods, and I'd like something like /info/product.id. In my callback, I'm just returning the argument, and printing a log with Watchdog. Just passing product works as expected, but product.id isn't returning anything and watchdog isn't logging anything.

Thanks

Read more
vkakani's picture

Retrieve a specific version (vid) of a node : D7

How do we retrieve a specific revision (vid) attributes of a node.

Works : http://mysite.com/endpoint/node?parameters[nid]=5&parameters[vid]=34 [vid=34 is the latest version version id]

Doesn't Works : http://mysite.com/endpoint/node?parameters[nid]=5&parameters[vid]=31 [vid=31 is the second version version id]

Please advise, how to construct the query to pull the a specific version ID related node attributes

Drupal Version : D7

Read more
casivaagustin's picture

Guía para Servicios REST en Drupal 7

Hola, les escribo para compartirles este Doc que escribí sobre servicios REST en drupal 7, es una guía bastante completa que surge del trabajo que realizamos en nuestra empresa y la escribí para que todos los que trabajan en la misma tengamos la misma visión sobre como laburar con el modulo Services y sus amigos.

Espero que les sirva

http://casivaagustin.com.ar/index.php/servicios-rest-en-drupal-7-la-guia/

Read more
thummel's picture

Consuming SOAP for SSO

Hi, I'm looking for a consultant that can help me consume soap for SSO from a third party service.

Read more
foredoc's picture

Integration of Drupal with c/c++ computational server

Hi,

I need to:

1) use drupal-powered web interface to collect user input (parameters);
2) invoke the computational modules/softwares written in c/c++ on a computational server with the parameters collected from the drupal site.
3) return the computational results to the drupal site.

I have been searching on the drupal sites, and I am wondering if Services module fit into my needs. If it is, can anybody give me some hints on how to achieve my goals?

Suggestions are very much appreciated.

Regards,

foredoc

Read more
casivaagustin's picture

Services + Oauth + JWT

Hello everybody, first of all I'm kind of lost here so If I'm not using the right terminology or what I'm saying have no sense please feel free to correct me, second I'm trying to get more information about this subject so any comment is really apreciated.

I'm trying to use Services with the Oauth2 Server but Using JWT.

I enabled the Services module, Created my own custom Endpoints, with no auth, worked perfectly.

I Enabled the Oauth2 Server, configured the server, the clientes, the scope. It worked.

Read more
firoz2456's picture

How to fetch Views total number of records in page.tpl.php before views.tpl called.

See this image http://prntscr.com/7idx70 for more understanding.

I want to fetch Views total number of records in page.tpl.php before views.tpl called. Is it possible to fetch that row total before views rendered? I am also using contextual filter for this view. Views have page type display.

I have also used module https://www.drupal.org/project/views_record_count. but this will print total number of records on Views header or footer. (Not outside of views)

Read more
skybow's picture

Why is a date field posted in one format and returned in a different?

I started working on a C++/Qt library for accessing a Drupal site via Services and a REST server (I'm more into C++ than PHP and Drupal module hacking), when I ran into the following problem: When I retrieve a node via node.retreive request, modify some fields of the returned JSON object and repost the changes via node.update request, Date field content will be killed.

Read more
EmmyS's picture

Unable to log in following quick-start guide (total beginner)

I've just installed the Services module, so I'm very new at this. I'm trying to follow the quick start guide at https://www.drupal.org/node/2424977. I was able to perform the first step (getting a token) using the REST Client add-on for Firefox. But when I try the second step (logging in), it returns nothing. No errors, just nothing.

Any ideas? Screenshot attached (and yes, for this test, "drupal_user" really is my username and password.)

Read more
darkdim's picture

JSON request to form for creating a node

Hi,
Please help to properly create Jason request to send a form to create a node

I get an error:

"form_errors": {
    "field_product][und][form][sku": "SKU field is required.",
    "field_product][und][form][commerce_price][und][0][amount": "Discount Price field is required.",
    "field_product][und][form][commerce_sales][und][0][value": "Sales field is required.",
    "field_timending][und][0][value": "A valid date is required for <em class=\"placeholder\">Valid Until</em>."

what am i doing wrong?

the query such

{"type": "deal","title": "Some title",

Read more
pmunch's picture

Cannot post node as authenticated user from phonegap

Hi all,

I have spent hours trying to figure this out as well as finding relevant code examples, I'm stuck...

I'm building a basic phonegap app that should allow to post a node as authenticated user. I can successfully login, but I cannot further post as this authenticated user thru X-CSRF-Token: I always get 403 - "Access denied for user 001" ...

I summed up the steps I follow in the dummy loginAndPost() function below.

<

pre>
function loginAndPost() {

// Set some vars

var username = "001";
var password = "001";
var server_uri = "http://my-drupal-website";
Read more
klimpab's picture

Service Module and REST: 404 Not found

Hello! I hope that this is the right place.

I strictly followed this guide. The REST Server is activated. I try to access http://localhost/rest/user/token.json (the Drupal installation is at localhost) via the Firefox REST Easy Add-On. No success. It always gives me a "404 Not Found" error.

Under the "Resources" Tab of the Service Module configuration, all resources are enabled. What am I doing wrong?

Read more
dsteplight's picture

Drupal Play Day at The Phase2 Treehouse 330 West 38th Street Suite 1405, New York, NY

Start: 
2015-02-21 12:00 - 17:00 America/New_York
Organizers: 
Event type: 
Training (free or commercial)

https://groups.drupal.org/node/457803

Read more
Chris87's picture

Rest Service path

Hi,
I have been playing with the Services module for a couple of days. According to REST API best practices, the GET URL paths I want to use are:
/buildings
/buildings/4
/buildings/4/rooms
/buildings/4/rooms/5

'Building' and 'room' are both content types, and '4' and '5', the node-ids.

Using the Services module, I can create the following calls:
/node/type=building
/node/4

And with the Services Views module, I can customise the path a little more:
/buildings

But the only way to get a specific building is by:
/buildings?nid=4

Read more
bogdog400's picture

Aggregator Module Extension | consultant

Employment type: 
Contract
Telecommute: 
Allowed

We need some help building a small module that will build an RSS block by implementing hook_aggregator_fetch so the URL will change dynamically with the page.

Let us know your time estimates and preferred payment methods.

Read more
jari.hollsten's picture

Check if a field value is present using json

I'm new to both services and json.
What I would need to achieve is to have a field on registering a new user to be checked if the value is present in another database using json. And if it is, go ahead registering the user otherwise throw an error message.

Read more
swafran's picture

Services REST node create - tnid not set

Hi

I'm using services and rest_server v.7.x-3.7 to update translations on my site.

When creating a node for a translation, I set the tnid, but it is always written in the db as 0.

If I change line 312 of node_resource.inc from:

$stub_node = (object) array_intersect_key($node, array_flip(array('type', 'language')));

to:

$stub_node = (object) array_intersect_key($node, array_flip(array('type', 'language', 'tnid')));

The tnid is properly written to the db and everything works fine.

Read more
Subscribe with RSS Syndicate content

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week