Comments (13)
Kind of... here is the api methods available in php: https://www.parse.com/docs/rest#users
I say kind of, because if you login a user in via the REST api, it will return their 'sessionToken'. 'currentUser' wouldn't really make sense when making calls via rest, its used to identify the person using the mobile device. The REST api is typically used so a server can add/update/delete data on parse for users, so when they do login, latest data is already there.
But another method is if a user opens your mobile app and makes a call to your php server, you could in theory identify them using a token that when checked against your servers database would point to the 'current user'. This article here, sort of touches on this subject and is a good read:
http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/
Not sure if this is your particular use case, let me know if you still have questions though.
from parse.com-php-library.
Thank you, that's great.
However bumped into a query, might be just me being stupid late on a monday afternoon, but can one login using this library? I tried using the GET method but its requiring an objectid?
from parse.com-php-library.
I'm working on that, it will be possible soon.
from parse.com-php-library.
phew. I thought for a minute I was going mad. I'll hang tight. Thanks.
from parse.com-php-library.
Hi, I'm having similar issues, I just want to get the details of one user with this library - I have tried with multiple user objectIds, I get a 404 error even though the id is perfectly valid.
from parse.com-php-library.
Can you please show me a small code sample that is not working for you. Also can you tell me if other functions of the library are working?
from parse.com-php-library.
Here's the code:
$user = array(
'className' => 'User',
'objectId' => $userId
);
// fetch user info.
$json = json_decode($parse->get($user), true);
print_r($json);
Anything other than user objects, the library works fine and returns the correct data.
from parse.com-php-library.
A couple things are off there. It looks like you are using the provided parseUser class. Try something like this instead:
//you first have to setup a new parse user instance
//then you can make all the user functions like get and query and signup.
$user = new parseUser;
$userData = $user->get($userId);
print_r($userData);
//Also no need to json_decode any of the stuff this library returns. Already done in the library.
Check out this file here for more examples:
https://github.com/apotropaic/parse.com-php-library/blob/master/tests/parseUserTest.php
from parse.com-php-library.
Ah, I'm still using v1 of the library, is this fix for the new one?
from parse.com-php-library.
yea it is.
from parse.com-php-library.
Ok, here's my code for retrieving a user object:
$parseQuery = new parseQuery('User');
$parseQuery->where('objectId',$args[1]);
$result = $parseQuery->find();
print_r($result);
I still get an empty response though, even though the table is populated:
stdClass Object ( [results] => Array ( ) )
I have constructed queries to other tables and they do work.
from parse.com-php-library.
Ah, problem solved, I forgot to run your first solution as the new query. Works perfectly now, thanks.
from parse.com-php-library.
Sweet! Glad to hear man.. just open up a new issue if you have any other
questions or suggestions.
On Tue, Mar 26, 2013 at 5:31 AM, liquidus219 [email protected]:
Ah, problem solved, I forgot to run your first solution as the new query.
Works perfectly now, thanks.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-15455246
.
from parse.com-php-library.
Related Issues (20)
- Reason for inclusion of all files? HOT 2
- Undefined property: stdClass::$code at line 267 in parse.php when "parse.com error: unauthorized" HOT 1
- Fatal error: Uncaught ParseLibraryException: [103]: parse.com error: class name must be a string thrown HOT 1
- Join two classes data HOT 2
- Many-to-Many relationship
- subscription always shows as 0 when send notification to android using reset api
- HELP URGENT on update row on User class using rest api
- saving or updating only works on string fields HOT 1
- cant save date to date field in parse HOT 2
- Failed to connect to api.parse.com port 443: Timed out HOT 1
- Issue with file upload HOT 1
- File Upload HOT 1
- I am trying to send a push notification using query where objectId equals to HOT 1
- how to write like oparator?
- How do I just get an array of everything in a table? HOT 4
- Cant save simple data
- how search file parseConfig.php? HOT 1
- how filter this error ?
- matches query in parse php
- Modified For Drupal HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parse.com-php-library.