Skip to content

Quick nodejs project to test and build ios app while backend is being built.

Notifications You must be signed in to change notification settings

JohannMG/MessagingMock

Repository files navigation

MessagingMock

Do not send anything confidential to this testing API. It is not secure.

Mocks the API endpoints for CCM App

##App Menu Content

Get Content
GET /api/{v1}/content/{id e.g., 'MyAAA'}

  • MyAAA now works for logged in and logged out users

##Accounts Must use BASIC authentication to pass a mock API key. base64(APIKEY)

API docs specify that all accounts fields are sent as string literals.

Returns random customerToken. Not actually valid.

Create User Account
POST /api/{v1}/authentication

  • If all fields valid strings and email validates as well returns successfully. Does not check numbers right now.
  • To simulate a 404 response, send a memebership number of all zeros(0).
  • To simulate a 409 response, send a zipcode of all zeros(0).

Authenticate User
PUT /api/{v1}/authentication

  • If all required fields are strings, returns normal response.
  • To simulate incorrent login pass username as "failauth" or either password or username as empty strings.

List of Username / Password that can authenticate

Get User Authentication
GET /api/{v1}/authentication

Get Customer
GET /api/{v1}/customer

##Messages Uses Basic Auth base64(MockAPIToken + ":" + MockUserID) If you need a new inbox to work with (all messages have been deleted) use a new UserID for a new mock inbox of messages

Get Customer Messages
GET /api/{v1}/customer/messages?offset={positive_integer}&limit={positive_integer}

  • Must call this endpoint to establish a new "inbox" for that user id

Get Customer Message
GET /api/{v1}/customer/messages/{id}

  • API Spec does not yet show how HTML will formatted in JSON, so currently sends minified HTML that uses single quotes to not interfere with JSON standard double quotes.

Update Customer Message
PUT /api/{v1}/customer/messages/{id}

Delete Customer Message
DELETE /api/{v1}/customer/messages/{id}

##KALPA

TODO: Get and Update KALPA Resources
GET /api/{v1}/kalpa/{KALPA-API-URL}

  • 401 is Customer Token not found

##Geo-Location

TODO: Store Device Location
GET /api/{v1}/device

  • Successful interaction results in a 204 response

How Basic Auth works https://developer.mozilla.org/en-US/docs/Web/HTTP/Basic_access_authentication

##Version Log

0.7

  • All default passwords now appended with 12345 to meet length expectations.
  • Adds Get Customer endpoint
  • Adds Get Authentication endpoint

0.6 Added the MyAAA menu endpoint for both logged in and out users.

0.5 Intro of user profiles. Only they can log in.

0.4 New user inbox now initialized with more messages

0.3 Added User Accounts endpoints

0.2 Changed message IDs to be 32-bit

0.1 Initial push to AWS with messages endpoints

About

Quick nodejs project to test and build ios app while backend is being built.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published