logo

Account Manager

Account Managers are the people responsible for handling orders, inquiries, invoices, and all operations performed by your company's client. A Account Manager is assigned to the customer. The account manager receives notifications of all orders and quotation requests of his customers to his primary email, and to an additional email. The client can see who his/her account manager is and his/her contact details. The scope of the client's guardian includes the email address, telephone number, ID, and guardian's name.
⚠️
It is possible using the API to get information about the current account manager, create a new account manager, edit, and delete current account manager in external system. In platform ONe it is possible to create and edit account manager

Table of contents:

Glossary

Name
Explanation
isOperator
If the value is true, it means that the account manager is also an operator who has access to Backoffice
name
Name of the account manager visible for the client
email
Account manager e-mail to which notifications are sent
additionalEmail
Account manager additional e-mail. Second e-mail to which notifications are sent
landlinePhone
Account manager landline phone number visible for the client
mobilePhone
Account manager mobile phone number visible for the client
photo
Link for account manager photo / The option is not yet available for the frontend
nextId
Next step identifier for synchronization. Each event generates a nextId number
id
Account manager identifier. Information about the ID is provided when creating an account manager via integration. Based on the ID it is possible to get information about account manager, update and delete account manager.
accountManagerId
Account manager identifier. Information about the ID is provided when creating an account manager via ONe platform. Based on the ID it is possible to get information about account manager, update and delete account manager.
type
Type of event (create, delete, update)

GET account managers

It is possible to get information about all account managers. In this case use GET /api/v1/account/integrations/auth-required/account-manager to receive information about all account managers.
The diagram below shows the dependence of communicating with the API:
Image without caption
Use the following query parameters to get list of all account managers:
  • rows - number of the result rows
  • start - first index of the result rows
Example request:
json
curl -X GET "https://api-preprod.one.unity.pl/api/v1/account/integrations/auth-required/account-manager?rows=1&start=1" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"
In response we will get whole list of account managers with details
Example response:
json
{ "listElement": [ { "id": "1", "name": "Name Surname", "email": "a.manager1@b2b.one", "additionalEmail": null, "mobilePhone": "111111111", "landlinePhone": null, "photo": null, "isOperator": true } ], "totalElement": 5, "items": [ { "id": "2", "name": "Name Surname2", "email": "a.manager2@b2b.one", "additionalEmail": null, "mobilePhone": "222222222", "landlinePhone": null, "photo": null, "isOperator": true } ], "totalItems": 5, "pageNumber": 2, "totalPages": 5, "pageSize": 1, "nextPage": 3 }

POST - Create account manager

Account managers can be created both in the external system and in ONe. In ONe it is possible in backoffice (Configurations β†’ Company β†’ Add user and it must be noted β€œIs account manager?”. Click here to see what to do when an account manager was created in ONe. Below we will explain how to do it via API.
Use POST /api/v1/account/integrations/auth-required/account-manager to create an Account Manager using the API.
The sequence diagram below shows the dependence of communicating with the API when account manager was created in external system:
Image without caption
If using the API to create an Account Manager you need in request to put required the following data:
  • email
  • id
  • name
You can also put additionally the following data:
  • additionalEmail
  • landlinePhone
  • mobilePhone
  • photo
Example request:
json
curl -X POST "https://api-preprod.one.unity.pl/api/v1/account/integrations/auth-required/account-manager" -H "accept:*/*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -H "Content-Type: application/json" -d "{ "email": "a.manager@b2b.one", -- required, account manager email address "id": "007", -- required, account manager unique identifier "mobilePhone": "333333333", -- account mobile phone "name": "Name Surname" -- required, account manager name }"
In response we will get information about data used in the request.
Example response:
json
{ "email": "a.manager@b2b.one", "id": "007", "mobilePhone": "333333333", "name": "Name Surname", }

GET account managers for synchronization

As previously mentioned, an Account Manager can also create in ONe.
The sequence diagram below shows the dependency of communicating with the API when account manager was created in ONe:
Image without caption
In this case first you must use GET /api/v1/account/integrations/auth-required/account-manager/synchronization to check if there have been any changes at the account manager level.
Use the following query parameters to find the events of the account manager:
  • context - list of the event, to choose: APPLICATION, BACKOFFICE, INTERNAL, INTEGRATIONS
  • startId - first index of the result rows
Example request:
json
curl -X GET "https://api-preprod.one.unity.pl/api/v1/account/integrations/auth-required/account-manager/synchronization?contexts=INTEGRATIONS&startId=6" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"
In response we will get information about next step ID and information about current step
Example response:
json
{ "nextId": 6, -- next step identifier "events": [ { "accountManagerId": "2020", -- account manager identifier "type": "CREATE" -- kind of event (create, delete, update) } ] }
When we see that the account manager has changed, we can use his ID to check the current data. Here's how to do it.

GET account manager by ID

Now as you have accountManagerId you can use GET /api/v1/account/integrations/auth-required/account-manager/{accountManagerId} to receive information about specific account manager using his ID.
The diagram below shows the dependence of communicating with the API:
Image without caption
Use the following query parameter to find the account manager you are looking for:
  • accountManagerId
Example request:
json
curl -X GET "https://api-preprod.one.unity.pl/api/v1/account/integrations/auth-required/account-manager/{id}" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"
In response we will get information about details of selected account manager
Example response (basic data):
json
{ "id": "1", -- account manager identifier "name": "Name Surname", "email": "a.manager@b2b.one", "additionalEmail": null, "mobilePhone": null, "landlinePhone": null, "photo": null, "isOperator": false }

PUT - Update account manager

Account manager information can be edited both in an external system and in ONe. If the account manager is edited in ONe, the further process is the same as in the case of creating a new account manager in ONe. Click here to go back to these steps.
Use PUT /api/v1/account/integrations/auth-required/account-manager/{accountManagerId} to update existing account manager in external system
The diagram below shows the dependency of communicating with the API:
Image without caption
In request you need to put query parameter:
  • accountManagerId
You can also change the data below:
  • additionalEmail
  • landlinePhone
  • mobilePhone
  • photo
In response we will get updated information
Example request:
json
curl -X PUT "https://api-preprod.one.unity.pl/api/v1/account/integrations/auth-required/account-manager/2020" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}" -H "Content-Type: application/json" -d "{ "email": "m.manager@b2b.one", -- required "name": "Name Surname", -- required "additionalEmail": "m.manager@b2b.one", "mobilePhone": "333 333 333", "photo": null }"

DELETE account manager

At the end you have the option to delete the account manager. Use DELETE /api/v1/account/integrations/auth-required/account-manager/{accountManagerId} to delete existing account manager.
The diagram below shows the dependency of communicating with the API:
Image without caption
In request you need to put query parameter:
  • accountManagerID
Example request:
json
curl -X DELETE "https://api-preprod.one.unity.pl/api/v1/account/integrations/auth-required/account-manager/{id}" -H "accept: */*" -H "one-tenant: {tenant}" -H "ApiAuth: {apiKey}"