B4J Question Help with Parse

derez

Expert
Licensed User
Longtime User
I made a Family Tree app which updates the DB at several users using PARSE.
It works nice and I made an equivalent app with B4j but the PARSE lib is not compatible.
Agraham showed me their REST API https://parse.com/docs/rest#users-login
It looks like something that can be done using HTTP and HTTPUTILS but I have no experience. The examples are in PYTHON or CURL.
For example : login process
B4X:
import json,httplib,urllib
connection = httplib.HTTPSConnection('api.parse.com', 443)
params = urllib.urlencode({"username":"cooldude6","password":"p_n7!-e8"})
connection.connect()
connection.request('GET', '/1/login?%s' % params, '', {
"X-Parse-Application-Id": "${APPLICATION_ID}",
"X-Parse-REST-API-Key": "${REST_API_KEY}"
})
result = json.loads(connection.getresponse().read())
print result

I made a successful connection :
B4X:
skt.Initialize("skt")
skt.Connect("api.parse.com", 443,0)

But got lost afterwards. I guess it should be job1.download2() with the username & password (which I have).
After login I need to get objects and send objects.
If someone could help – I’ll appreciate.
 

derez

Expert
Licensed User
Longtime User
To update an object I have to put its objectId in the path.
I want to access the object not by its objectId but by one of the fields (like "No" = 110), like I do when I want to get the object, and then update some of its fields. So it is not an output to achieve, its an input !
In the library now it is doing first a query to get the ID and then the update. If what I ask is possible it will save a cycle at parse.
 
Upvote 0

derez

Expert
Licensed User
Longtime User
I have a working solution but I wanted to know if using "where" is possible.
Thank you.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…