Data Sync

48 views
Skip to first unread message

simplisti...@gmail.com

unread,
Feb 26, 2013, 1:46:38 PM2/26/13
to node...@googlegroups.com
I would like to setup a Noda.ACS app that automatically syncs data from one external system, into ACS at regular intervals. Possible?

aaron saunders

unread,
Feb 26, 2013, 2:27:15 PM2/26/13
to node...@googlegroups.com, simplisti...@gmail.com
Just use something like this and you should be set

Peter Lee

unread,
Feb 26, 2013, 2:30:29 PM2/26/13
to node...@googlegroups.com, simplisti...@gmail.com
This module worked on me as well.

simplisti...@gmail.com

unread,
Feb 26, 2013, 10:20:18 PM2/26/13
to node...@googlegroups.com, simplisti...@gmail.com

Thanks a lot. I got this working really quickly. Any issues with "restarts" using this?

simplisti...@gmail.com

unread,
Mar 22, 2013, 1:09:02 PM3/22/13
to node...@googlegroups.com, simplisti...@gmail.com
On Tuesday, February 26, 2013 10:46:38 AM UTC-8, simplisti...@gmail.com wrote:
> I would like to setup a Noda.ACS app that automatically syncs data from one external system, into ACS at regular intervals. Possible?

I need to authenticate on the server side as an admin to be able to sync (POST) data to the ACS custom objects. Have any of you done this or have any guidance on how to approach?

simplisti...@gmail.com

unread,
Mar 22, 2013, 1:17:58 PM3/22/13
to node...@googlegroups.com, simplisti...@gmail.com
On Tuesday, February 26, 2013 10:46:38 AM UTC-8, simplisti...@gmail.com wrote:
> I would like to setup a Noda.ACS app that automatically syncs data from one external system, into ACS at regular intervals. Possible?

To clarify, the flow is like the following:

Start Server
Start Cron to sync at regular intervals
Authenticate to ACS (login)
Post to ACS (fail) 401

It seems the authentication is not getting recorded or session information saved so that subsequent post requests can be made

Peter Lee

unread,
Mar 22, 2013, 1:22:23 PM3/22/13
to node...@googlegroups.com, simplisti...@gmail.com
Can you provide a code how you authenticate and post to ACS?

simplisti...@gmail.com

unread,
Mar 22, 2013, 1:28:47 PM3/22/13
to node...@googlegroups.com, simplisti...@gmail.com

I have tried multiple ways:
Using Restler: This authenticates and I get a 200 code back:
rest.post('https://api.cloud.appcelerator.com/v1/users/login.json?key=<myappkey>&login=myemail&password=mypassword', {
// other stuff here
})

But on complete of this, no other posts that require login work. It's like I never logged in.

Peter Lee

unread,
Mar 22, 2013, 1:38:51 PM3/22/13
to node...@googlegroups.com, simplisti...@gmail.com
Is there a reason you are using restler?
If you need to use restler you would need to get the session_id which is returned when login is successful.
With that session_id you make a acs api call.

Or you can simply use ACS module, check sample app pixgrid guide http://developer.appcelerator.com/blog/2012/11/node-acs-tutorial-1-pixgrid-photo-uploader.html

simplisti...@gmail.com

unread,
Mar 22, 2013, 1:52:38 PM3/22/13
to node...@googlegroups.com, simplisti...@gmail.com
Not necessarily other than it's a clean rest approach.

The only other difference between the other examples is they are using acs for rest on the clientside and i need it on the server for cron.

Peter Lee

unread,
Mar 22, 2013, 1:54:53 PM3/22/13
to node...@googlegroups.com, simplisti...@gmail.com
Try:
When you login you will get session_id, such as

  "meta": {
    "code": 200,
    "status": "ok",
    "method_name": "loginUser",
    "session_id": "dvsOGR_cEJBTeg5AhoQxKz51-yQ"
  }

pass in session_id as well on your api call.

On Tuesday, February 26, 2013 10:46:38 AM UTC-8, simplisti...@gmail.com wrote:

Wei Kong

unread,
Mar 22, 2013, 2:04:21 PM3/22/13
to node...@googlegroups.com, simplisti...@gmail.com
Make sure to pass as

_session_id=<session_id> in the url

This is the only way to get it work.

--
You received this message because you are subscribed to the Google Groups "Node.ACS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-acs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages