views:

191

answers:

1

Hi,

I'm playing with the Mojo SDK and I want to get all contacts.

this.controller.serviceRequest('palm://com.palm.contacts/crud', {
     method:   'listContacts',
     parameters: {
       limit: 100
     },
     onSuccess: this.handleListResponse.bind(this),
     onFailure: function(errResp){
       Mojo.Log.info(errResp.errorText)
     }.bind(this),
     onerror: function(errResp){
       Mojo.Log.info(errResp.errorText)
     }.bind(this)
});

This is what I have right now, but I don't get anything back. And Mojo.Log.info doesn't seem to work. Any suggestions?

Thanks

A: 

I'm also fairly new at PRE development but here is what I think the issue is.

The error that comes back is "Account Not Found". You need to add accountId: as a parameter to the service request.

That account id, according to the documentation, is a Synergy account and needs to be created for your application. Click here for reference about the accountId and createAccount methods

Cody C
The note in your link says everything:Note: To prevent unauthorized use of private user data, this API provides access only to records created by your application; that is, you cannot access records owned by another application.Also you are right about the accountID
carnz
it makes you wonder why they would include that in the API then. If other developers are unable to use it, why even put it in the documentation. The documentation still has a ways to go in general but it's a good guide to get started. The real difficulty is that there really isn't information anywhere (i.e. google) for this stuff so much of it is trial/error.
Cody C