Skip to content

Instantly share code, notes, and snippets.

@anselmelly
Last active May 19, 2021 08:26
Show Gist options
  • Select an option

  • Save anselmelly/b6c7a3191580be1fa8340e28c3dbd72a to your computer and use it in GitHub Desktop.

Select an option

Save anselmelly/b6c7a3191580be1fa8340e28c3dbd72a to your computer and use it in GitHub Desktop.

Resend verification Code

POST /api/resend-verification-code

  • user has to be logged in
  • sms can only be sent 3 times
  • any subsequent request will be tagged as pending for the administrator to review

response (max messages not reached)

{
    "data": {
        "response": "success",
        "message": "verification code sent"
    }
}

response (max messages reached)

{
    "data": {
        "response": "error",
        "message": "max messages reached. please contact administrator"
    }
}

Admin Verify User

POST /api/verify-app-user/{id}

verify user details

allowed status is complete or rejected

params

{
    "status":"complete | rejected"
}

response

{
    "data": {
        "response": "success",
        "message": "user verified"
    }
}

App user

post api/app-user

response

{
    "data": {
        "id": 146,
        "phone_number": "+254723603314",
        "first_name": "Melly ",
        "last_name": "Ansel",
        "role": {
            "id": 2,
            "name": "appuser",
            "privileges": []
        },
        "is_verified": true,
        "admin_verification_status": "complete",
        "admin_verification_duration": 21,
        "register_source": "app",
        "location_changes": {
            "change_count": 9,
            "max_change_count": 3
        },
        "created_at": [],
        "subscriptions": [
            {
                "id": 608,
                "app_user_id": 146,
                "order_id": "0723603314",
                "amount": "500.00",
                "currency": "KES",
                "subscription_start": null,
                "subscription_end": null,
                "order_status": "incomplete",
                "created_at": "2019-12-18 12:46:36",
                "updated_at": "2019-12-18 12:46:36",
                "deleted_at": null,
                "package_id": null
            }
        ],
        "location": {
            "id": 32,
            "name": "Laisamis",
            "country": {
                "name": "Kenya",
                "code": 254,
                "iso2": "KE",
                "iso3": "KEN"
            }
        }
    },
    "meta": {
        "subscription": {
            "subscription_period": 365,
            "subscription_amount": "2000",
            "currency": "KES",
            "providers": [
                {
                    "id": 1,
                    "name": "kenya.safaricom",
                    "account": "351545"
                },
                {
                    "id": 2,
                    "name": "kenya.airtel",
                    "account": "660099"
                },
                {
                    "name": "Telkom",
                    "account": "123233",
                    "id": 3
                }
            ],
            "subscription_start": "",
            "subscription_end": "",
            "status": "expired",
            "days_remaining": "0"
        },
        "trial": {
            "trial_period": 91,
            "trial_start": 1589490000,
            "trial_end": 1597438800,
            "status": "expired",
            "remaining_days": 0
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment