Copy STAGING_URL: https://switchapi3.azurewebsites.net
LIVE_URL: https://switchapi.azurewebsites.net
Register User
POST
https://switchapi3.azurewebsites.net/user/register
Registers user and returns a valid token used for session validation
Request Body
200 400
Copy {
"message": "User created successfully",
"data": {
"auth_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMzk2IiwiY29udGV4dCI6InVzZXIiLCJpYXQiOjE1NzcyODg1MjksImV4cCI6MTU3NzI5MDMyOX0.2AwxVSj2QzYCB5cZySUjJ8nRU3guZHtgQbvl1BcQWyc",
"user": {
"is_verified": false,
"blacklisted": false,
"two_factor_authentication_enabled": false,
"two_factor_authentication_type": "none",
"phone_verified": false,
"pin_set": false,
"google_auth_set_up": false,
"disabled": false,
"has_pending_disable_request": false,
"has_pending_enable_request": false,
"fraud_status": "whitelisted",
"id": "396",
"email": "someone@gmail.com",
"first_name": "Somebody",
"last_name": "Anybody",
"date_of_birth": "1996-10-06",
"phone": "+2348097635343",
"gender": "male",
"country": "NG",
"photo_id_url": null,
"image_selfie_url": null,
"signature_url": null,
"address": null,
"switch_id": 100496,
"payment_link_slug": null,
"city": null,
"state": null,
"zipcode": null,
"last_sign_in": null,
"photo_id_issuer": null,
"photo_id_number": null,
"photo_id_expiry": null,
"switch_bank_account_name": null,
"switch_bank_account_number": null,
"nigerian_contact_name": null,
"nigerian_contact_phone": null,
"nigerian_contact_address": null,
"nigerian_contact_relationship": null,
"switch_bank_customer_id": null,
"verified_at": null,
"verification_requested": false,
"bvn": "22xxxxxx032",
"security_question_set": false,
"is_diaspora": false,
"has_wallet": false
}
}
}
Copy {
"message": "Error occurred creating user",
"errors": {
"password": "must contain at least one upper case letter, one lower case letter, one digit and at least one special character"
}
}
Login User
POST
https://switchapi3.azurewebsites.net/user/login
Authenticates user and returns a valid token used for session validation.
Request Body
200 Successful login 401 Unsuccessful login
Copy {
"message" : "User login successful" ,
"data" : {
"auth_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMTEiLCJjb250ZXh0IjoidXNlciIsImlhdCI6MTU3NzI4ODkwMCwiZXhwIjoxNTc3MjkwNzAwfQ.Aqt4XZbsQqc8UqEuh51ytc7IrNMEhXSPFSvdX3BQSpw",
"user" : {
"id" : "11" ,
"email" : "beyonceknowles@gmail.com" ,
"phone" : "+2348154634619" ,
"first_name" : "Beyonce" ,
"last_name" : "Knowles" ,
"date_of_birth" : "1981-09-04" ,
"photo_id_url" : "+2348154634619_id_card_beyonce.jpg" ,
"image_selfie_url" : "+2348154634619_image_selfie_url_beyonce.jpg" ,
"signature_url" : null ,
"address" : "19, Okotie Eboh" ,
"is_verified" : false ,
"gender" : "female" ,
"country" : "NG" ,
"blacklisted" : false ,
"switch_id" : 100111 ,
"two_factor_authentication_enabled" : true ,
"two_factor_authentication_type" : "pin" ,
"phone_verified" : true ,
"pin_set" : true ,
"payment_link_slug" : "100111" ,
"city" : "Ikoyi" ,
"state" : "Lagos" ,
"zipcode" : "101233" ,
"last_sign_in" : "2019-02-11T13:21:59.409Z" ,
"photo_id_issuer" : null ,
"photo_id_number" : null ,
"photo_id_expiry" : null ,
"switch_bank_account_name" : null ,
"switch_bank_account_number" : null ,
"google_auth_set_up" : false ,
"nigerian_contact_name" : null ,
"nigerian_contact_phone" : null ,
"nigerian_contact_address" : null ,
"nigerian_contact_relationship" : null ,
"switch_bank_customer_id" : null ,
"disabled" : false ,
"has_pending_disable_request" : false ,
"has_pending_enable_request" : false ,
"fraud_status" : "whitelisted" ,
"verified_at" : null ,
"verification_requested" : false ,
"bvn" : null ,
"security_question_set" : true ,
"is_diaspora" : false ,
"has_wallet" : true
}
}
}
Copy {
"message" : "Invalid login details"
}
Forgot Password
POST
https://switchapi3.azurewebsites.net/user/forgot_password
Creates a reset password token, attaches it to user account and sends a reset link to user's email
Request Body
200 password reset email successfully sent
Copy {
"message": "If this email exists, a password reset email will be sent to it"
}
Reset Password
POST
https://switchapi3.azurewebsites.net/user/reset_password
Resets user password
Request Body
200 400
Copy {
"message": "Password changed successfully"
}
Copy {
"message": "Password could not be updated",
"errors": {
"password": "can't be blank"
}
}
Unlock Account
POST
https://switchapi3.azurewebsites.net/user/unlock_account
Unlocks a locked account
Request Body
200 400
Copy {
"message": "Account unlocked successfully"
}
Copy {
"message": "Account could not be unlocked",
"errors": {
"unlock_token": "is invalid"
}
}
Resend Unlock Email
POST
https://switchapi3.azurewebsites.net/user/resend_unlock_email
Re-sends the unlock email
Request Body
200
Copy {
"message": "If this email exists and there's a lock, unlock instructions will be sent to it"
}
Logout
POST
https://switchapi3.azurewebsites.net/user/logout
Invalidates the session token
200 401
Copy {
"message": "User session invalidated"
}
Copy {
"message": "Invalid token"
}
Validate user's BVN details
POST
https://switchapi3.azurewebsites.net/user/validate_user_bvn
Validates the user's bvn.
Request Body
200 400
Copy {
"message": "BVN validated successfully"
}
Copy {
"message": "BVN is invalid, please confirm your bvn and try again"
}
Send email confirmation
POST
https://switchapi3.azurewebsites.net/user/send_email_confirmation_mail
This endpoint is used to send a confirmation email to a user.
Request Body
200
Copy {
"message": "Confirmation email sent"
}
Get Referrer
GET
https://switchapi3.azurewebsites.net/user/referrer/:switch_id
This endpoint gets the referrer using the switch_id.
Path Parameters
200 400
Copy {
"message": "Referrer retrieved successfully",
"data": {
"first_name": "Dan",
"last_name": "Sawyerr",
"switch_id": "100789"
}
}
Copy {
"message": "Invalid referral link"
}