Log in to create an API key

POST/auth/login

This endpoint is to login so you can create an API key. You need to be signed up to MyGigsters first to be able to log in this way.

Request Body

Required: Yes
Content-Type: application/json
ParameterTypeDescription
email *stringYour email you signed up with MyGigsters

Responses

Content-Type: application/json
Response CodeDescriptionSchema
200A User object
ParameterTypeDescription
messagestringResponse from server
400Email not provided
ParameterTypeDescription
errorsstringError message regarding email
404Email not found on the system
ParameterTypeDescription
errorsstringError message regarding email
500Unknown system error
ParameterTypeDescription
errorstringError message regarding email

Sample Request - cURL

curl 'https://super.mygigsters.com.au/auth/login' -X POST \
         -H "Content-Type: application/json" --data '{"email":"email@email.com"}' 

Sample Response - 200

{
  "message": "OTP sent to your email"
}

Verify OTP received after login

POST/auth/verify-otp

This route returns the JWT for use with API Keys routes (/api-keys/) - note that the OTP is always 123456 for non-production environments

Request Body

Required: Yes
Content-Type: application/json
ParameterTypeDescription
otp *stringOne Time Pin to be sent in string format
email *stringThe email address which you requested the OTP for

Responses

Content-Type: application/json
Response CodeDescriptionSchema
200Response with the JWT to use for the rest of the API Keys routes
ParameterTypeDescription
messagestringInformation about response
clientIdintegerClient ID of the user
emailstringEmail of user
tokenstringJWT for use with API Keys routes
400Missing info in request body
ParameterTypeDescription
errorsstringInformation about missing data
404Cannot find user or invalid OTP
ParameterTypeDescription
messagestringInfo about the error

Sample Request - cURL

curl 'https://super.mygigsters.com.au/auth/verify-otp' -X POST \
         -H "Content-Type: application/json" --data '{"otp":"123456","email":"email@email.com"}' 

Sample Response - 200

{
  "message": "OTP verified successfully",
  "clientId": 1,
  "email": "idea@woodevelopment.com",
  "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEsImV4cCI6MTc2NjQ0MDg3MiwiaWF0IjoxNzY2NDM3MjcyfQ.N5z-MpfLZqwUrD1Cc0Kj2ciZ9i66I5SIDH0C8daFpkcX_VNcZ_I8ZgW_GLTAnwWjdY_J1e7T7FcwPxxK3MwN9_G5vUIuSRlqzVw87NHhZLS6yIL41wSQ2oJjT0esFO8V7FjakiPuU4qc5duXYWyfeqX8faYzxsD4j0o1L7GqoEHqoaVp-RkOXdPSTmveZI7HqdzqXPgRcLprY3E8Bd59JX5oM8ynf8SKy5GOWSh4VsIhOTZsVO9CPhzBPglTUona1ZpWU9JtwRnwI3LxycuosUvwmJJ8w-bGPhUazRcKmRevE1e29nvqNWPa0RH3f4uneSnS4GYJh3APCvblpwWeHBvtvpAXT84RkWv0dKr5QAZh3wFVGvOcLpIwPP0MXwDNYeZTkR_l_tIRUzSeU56H2hC5kj_X5emR-p76mwnY9dIfYZax3aSxMPeHgyTchR3DQUok-DIZvGLoGE731E1Sqc2eC1itjNjaBqsr_DcwPapXljtI01pCrIZ9TXkH4XgyrCtSrFps9uviv28_GMzIgJcJ6J7PTLpdrOGtY3LWe7bKGksTwe2LkQb-Oj2HyUr7GMMOFhw7wMUz_mrUjJ2pJjFi1XrNEwzApx9UJw1dDC7GiQTxJPH9SvL_re6zH0qK99OtKAU9gCczdMkQ29tBGT0HJrpWDyb62E8j9y5C-EU"
}

Adds a new API Key

POST/auth/create

This endpoint creates an API key. The API Key is to be used in Basic Authentication format eg. curl -u "apiUsername:apiPassword". To access this endpoint you need to obtain a JWT via Get OTP and Verify OTP sections.

Request Body

Required: Yes
Content-Type: application/json
ParameterTypeDescription
name *stringThe friendly name for your key - for your reference only

Responses

Content-Type: application/json
Response CodeDescriptionSchema
200An API Key object
ParameterTypeDescription
apiUsernamestringThe Basic Auth API Key user name
apiPasswordstringThe Basic Auth API Key password (only shown once for security)
400Invalid API Key details
ParameterTypeDescription
errorstringThe error message

Sample Request - cURL

curl 'https://super.mygigsters.com.au/auth/create' -X POST \
    -H "Authorization: Bearer JWT_FROM_VERIFY_OTP_STEP"  \
    -H "Content-Type: application/json" --data '{"name":"My Key"}' 

Sample Response - 200

{
  "apiUsername": "39534898-f44e-461e-99fb-c27f3bdd515b",
  "apiPassword": "(Qlpej#UXs5NLCS$Rk&+"
}

List your API Keys

GET/auth/list

This endpoint lists API keys. The API Key is to be used in Basic Authentication format eg. curl -u "apiUsername:apiPassword". To access this endpoint you need to obtain a JWT via Get OTP and Verify OTP sections.

Responses

Content-Type: application/json
Response CodeDescriptionSchema
200The API Key objects
ParameterTypeDescription
idstringThe API Key ID.
namestringFriendly name of the API Key
apiUsernamestringThe Basic Auth API Key user name

Sample Request - cURL

curl 'https://super.mygigsters.com.au/auth/list' \
    -H "Authorization: Bearer JWT_FROM_VERIFY_OTP_STEP"  

Sample Response - 200

[
  {
    "id": "1231412313213",
    "name": "My Key",
    "apiUsername": "29954bf9-c379-4107-8ed6-7af7eaf30981"
  }
]

Deletes an API Key

DELETE/auth/delete-key

This endpoint deletes an API key. To access this endpoint you need to obtain a JWT via Get OTP and Verify OTP sections.

Request Body

Required: Yes
Content-Type: application/json
ParameterTypeDescription
id *stringThe ID of your key (not the friendly name)

Responses

Content-Type: application/json
Response CodeDescriptionSchema
200API Key deleted
ParameterTypeDescription
messagestringSuccess message
204No Content
400API Key not provided
ParameterTypeDescription
errorstringError message
404API Key not found
ParameterTypeDescription
errorstringError message

Sample Request - cURL

curl 'https://super.mygigsters.com.au/auth/delete-key' -X DELETE \
    -H "Authorization: Bearer JWT_FROM_VERIFY_OTP_STEP"  \
    -H "Content-Type: application/json" --data '{"id":"1231412313213"}' 

Sample Response - 200

{
  "message": "API Key deleted"
}

Sample Response - 204

{}