Creating a permission offer returns 601


I’m implementing function of granting permission to some user via QR code, to achieve that based on documentation I have to use PermissionManager class to create an offer which is implemented like below:

PermissionManager pm = SyncUser.current().getPermissionManager();

    // Create Offer
    Date expiresAt = new GregorianCalendar(2019, Calendar.FEBRUARY, 11).getTime();
    AccessLevel accessLevel = AccessLevel.READ;
    PermissionOffer offer = new PermissionOffer(REALM_BASE_URL, accessLevel, expiresAt);    

    // Accept token
    pm.makeOffer(offer, new PermissionManager.MakeOfferCallback() {
        public void onSuccess(String offerToken) {
            Log.d("OfferSuccess", offerToken);

        public void onError(ObjectServerError error) {
            // An error happened
            Log.d("OfferError", error.getErrorMessage());

Every time I run this function I got an error message saying:

INVALID_PARAMETERS(601) Your request parameters did not validate.

can anybody tell me why is returning this error when I tried like in the documentation. Did I forget to add something in configuration or does anybody had this issue before. Thanks in advanced.