You need to sign in to do that
Don't have an account?
Rest API for J2ME Mobile app
Hi,
I am planning to use the Rest API to access Salesforce from a J2ME device.
I cannot use OAUTH2 as I dont want a web application running on a mobile.
As another person suggested we can pass the sessionId to the Rest API. However to do so requires
SOAP libraries.
I am wondering :
1) Are SF Soap libraries compatible with J2ME?
2) Is there a way to get the sessionID by any other means to pass to REST based API instead of using SOAP?
I expected that the REST based api would accept the username/password/token and would return the session ID but this seems not to be supported.
Thanks
-Jimmy
There's a PHP code sample that does the OAuth username/password login in this discussion board message.The HTTP query URL is the same whether you're running PHP or Java, so you should be able to get it working from there.
It's worth reading through the rest of the thread for the instructions on allowing API access, and, also, please note that the REST API is still in developer preview and not for production use.
All Answers
You can use the username/password oAuth2 flow. Or you can use the regular oauth2 flow with a custom URL scheme for the callback URL, these are fairly easy to hook in a lot of environments (i don't know about J2ME though)
There's a PHP code sample that does the OAuth username/password login in this discussion board message.The HTTP query URL is the same whether you're running PHP or Java, so you should be able to get it working from there.
It's worth reading through the rest of the thread for the instructions on allowing API access, and, also, please note that the REST API is still in developer preview and not for production use.
Appreciate your help guys.
-Jimmy
Hi,
Here's a link with the code to perform username/pwd flow of OAuth 2.0 in java
http://techstuffplus.blogspot.com/2011/01/rest-based-webservice-calls-to.html
Thanks
-Jimmy.