/
Interface - Revision2

Interface - Revision2

https://app.swaggerhub.com/apis/EddlesA/G21_fudge_api/1.0.0

Method

Name

Description

Parameters

Return values

Exceptions

Method

Name

Description

Parameters

Return values

Exceptions

POST

/sendInvoice

Sends UBL invoice via email to specified addresses. Returns a communication report informing user of success/errors: if unsuccessful, the report has errors (eg. email address invalid, connection not etablished etc.). It also includes address, client, time/date. It will be readable for humans to understand. Should also save a record of the transaction

Header:

{

token : (String)

}

File:

invoice (UBL 2.1 XML)

communicationReport (JSON)

{

"sentMail": (boolean),

"readable_errors": (string),

"xmlFound": (boolean),

"xmlRightSize": (boolean),

"emailValid": (boolean),

"connectedToMail": (boolean),

"timeSent": (datetime),

"timeTaken": (int)

}

400 errors:

  • Invalid/Missing email address

  • No XML invoice

403 errors:

  • Invalid token

413 errors:

  • XML invoice >10MB

GET

/HealthCheck

Health check endpoint that indicates the aliveness of this service. Gives information about success, server up time, number of transactions and current version.

None

{

alive: (boolean)

serverUpTime: (Integer)

numTransactions: (Integer)

currentVersion: (String)

}

None

POST

/newSession

Returns a new token for user to use for this session.

 

{

username : (String)

password : (String)

}

{

token : (String)

}

400 errors:

  • Invalid email

  • Invalid password

POST

/createNewUser

creates a new user account with a given email, name, username and password. The set username and password will be used when calling /newsession. Username and password name must be between (and including) 5-100 characters long. Username must also be unique.

{

email : (String)

username : (String)

password : (String)

}

{

success: (boolean)

}

400 errors:

  • Invalid email

  • Email already in use

  • Invalid username

  • Username already in use

  • Invalid password

POST

/endSession

revokes the token given to the endpoint. This should be used by all users on their servers shutdown. Sessions are automatically deleted after an hour.

{

token : (String)

}

None

403 errors:

  • Invalid token

 

Related content

Deployment/ Updated Stack Architecture
Deployment/ Updated Stack Architecture
Read with this
Project Management & Communications
Project Management & Communications
Read with this
Standup Sprint 2
Standup Sprint 2
Read with this
Software Architecture & API Design
Software Architecture & API Design
Read with this
Requirements
Requirements
Read with this
Sprint 2
Sprint 2
Read with this