REST API

can somebody help me with this error ? "Trying to get property of non object". The error points to lines were is asign user_name , password.....birthday

  $app->post('/myapi/users', function () use ($app) {
        $user = $app->request->getJsonRawBody();

        $phql = "INSERT INTO Users (user_name, password, gender, screen_name, birthday) VALUES (:user_name:, :password:, :gender:,:screen_name:,:birthday:)";
        $status = $app->modelsManager->executeQuery($phql, array(
            'user_name' => $user->user_name,
            'password' => $user->password,
            'gender' => $user->gender,
            'screen_name' => $user->screen_name,
            'birthday' => $user->birthday

        ));

My guess is that you don't have modelsManager set as a service. Do you have something like in your code?

$app->set('modelsManager', function() {
      return new ModelsManager();
});

From the docs here: https://docs.phalconphp.com/en/latest/api/Phalcon%5Mvc%5Model%5Manager.html

Do a var_dump on the $user variable so as to determine whether getJsonRawBody() returned correct data for you.