Account users / members
Entity responsible for getting user from a company, this is specifically used to get responsible users while importing properties or units
GraphQL Endpoint
GraphQL endpoint to perform user operations
POST
https://{custom_subdomain}.everreal.co/api/reporting/graphql
Body of the request should follow GraphQL mutation structure like
mutation {
mutationName(input: {MutationNameInput!})
{ MutationNamePayload }
}
Account user Query
To query an user from Everreal use user query
GET http://{custom_subdomain}.everreal.co/api/reporting/graphql
--header 'Authorization: Bearer eyJhbGci...'
{"query":"..."}
type User {
id: String
email: String
firstName: String
lastName: String
profilePicture: IFile
companyUser: companyUser
}
type companyUser {
companyId: String
}
type Query {
users(input: UserFilterListPaging): [User]
}
input UserFilterListPaging {
filter: UserFilter
paging: GraphPaging
sort: GraphSorting
}
input UserFilter {
id: String
email: String
}
Below we are providing a full example how to get a user by email
query {
users(input: { paging: { take: 10, skip: 0 }, filter: { email: "email@domain.co" } }) {
id
email
}
}
curl --location --request POST 'http://{subdomain}.everreal.co/api/reporting/graphql' \
--header 'Authorization: Bearer ....' \
--header 'Content-Type: application/json' \
--header 'Cookie: accept-language=de-DE' \
--data-raw '{"query":"query {\r\n users(input: { paging: { take: 10, skip: 0 }, filter: { email: \"email@domain.co\" } }) {\r\n id\r\n email\r\n }\r\n}","variables":{}}'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer ...");
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Cookie", "accept-language=de-DE");
var graphql = JSON.stringify({
query: "query {\r\n users(input: { paging: { take: 10, skip: 0 }, filter: { email: \"email@domain.co\" } }) {\r\n id\r\n email\r\n }\r\n}",
variables: {}
})
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: graphql,
redirect: 'follow'
};
fetch("http://{subdomain}.everreal.co/api/reporting/graphql", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));