Create a Profile - nick-nack-attack/truth-checker-api GitHub Wiki

Create a Profile

Overview

Public users of the app can create an account to create facts and edit facts they've created.

Functionality

API - Random User

Link to documentation: https://randomuser.me/documentation When the user creates their profile, it will make an API call to get a random set of user information.

https://randomuser.me/api/?format=JSON&exc=registered,cell&nat=us&noinfo&results=1

  • format is set to JSON data format.
  • exc will exclude registered and cell fields
  • nat is set to United States so all users are 'us citizens'
  • noinfo included so only the data is returned and seed, results, page, and version data is not returned
  • results is set to one so only one person is returned

Fake user data

This is stored in database as the following: 'gender', 'full_name', 'address', 'latitude', 'longitude', 'uuid', 'inbox', 'date_of_birth', 'phone', 'ssn', 'photo_url'

  • Gender : results[0].gender

  • Full name : results[0].name.first + results[0].name.last

  • Address : results[0].location.street + results[0].location.city + results[0].location.state + results[0].location.postcode

  • Latitude : results[0].latitude

  • Longitude : results[0].longitude

  • UUID : results[0].login.uuid

  • Inbox : results[0].email

  • Date of Birth : results[0].dob.date

  • Phone : results[0].phone

  • SSN : results[0].id.value

  • Photo : results[0].picture.large