This document is assumed that you're already familiar with Graphql.
NOTE: This API is under heavy development. Please link to development GraphiQL Endpoint for full and upated schema details.
Type: Mutation
Request
authSignup(
username: String
password: String
companyId: String
email: String
): AuthResponse
Response
AuthResponse(
accessToken: String
cred: AuthCred
expiresAt: Int
refreshToken: String
tokenType: String
)
AuthCred(
meth: String
resp: String
val: String
)
If successful, other field except AuthCred
should be null. And it should contain meth = "email"
and val = "email@sample.com"
.
The validation code will be sent to your email.
Type: Mutation
Request
authLogin(
username: String
password: String
companyId: String
cred: AuthCredInput
): AuthResponse
AuthCredInput(
meth: String = ""
val: String = ""
resp: String = ""
)
AuthCredInput if the user has not been validated yet, this field should contain meth: "email"
resp: "CONFIRMATION CODE"
. The other fields can be null.
Response
AuthResponse(
accessToken: String
cred: AuthCred
expiresAt: Int
refreshToken: String
tokenType: String
)
In successful, accessToken
and tokenType
should be return. Current tokenType
supported now is Bearer
.
The client must set Authorization: Bearer 'token'
in the request header before calling query or mutation transaction.
If the user has no any associated company, he can create a new company calling to createCompany
mutation.
Type: Mutation
createCompany(input: CreateCompanyInput): Company
If there is aleady existing company, the user can call joinCompany
to join the existing one.
Type: Mutation
joinCompany(companyId: String): Company
The user can send invitation to others to join company he already is associated.
The email sent by the server contains the companyId
so the client can grab it and call joinCompany
.
Type: Mutation
sendJoinCompanyInvitation(emails: [String]): [InvitationResponse]