Skip to main content

AFAS (User Invitation and Sync)

Updated over 3 weeks ago

What can be expected?

  • Every employee that exists in Afas will be invited into MobieTrain.

  • The employee, will have to accept the invitation and set a password. From that moment on, he’ll be able to log into MobieTrain with his new credentials.

  • All the existing users’ information will be updated in a period of 24 hours.

  • Users will be automatically assigned to User Groups, through their Job Position.

  • Users will be automatically assigned to Stores, through their Organization.

  • When a user no longer exists in Afas, it will be removed from the MobieTrain platform, along with any invitation that might be attached to him.

How does it work?

  1. Every day at 6:00 UTC, the synchronization is run (Daily Sync).

  2. If employee starting date is in the future, then he is skipped.

  3. If the user has an end date in the past - no longer works at the company - we remove the user and any invitation assigned to it.

  4. If a user doesn’t exists, an invitation is created - with his User Groups and Stores correctly assigned - and sent.

Users, in MobieTrain, will be automatically assigned to User Groups, through their Job Position. In the same way, Users will be automatically assigned to Stores, through their Organization. If the given User Groups or Stores don’t exist, they will be created, automatically.

All the users that exist in Afas are updated, every day, if their information changes.

If an invitation is not accepted after 6 months, it is removed from MobieTrain. Of course that if the user still exists in Afas, in the next sync, he’ll be invited again.

What are the dependencies?

For the integration to work, our client needs to have an AFAS account, and they need to install our GetConnector. The GetConnector is a file that will be provided by MobieTrain, that will allow the account to send the right information to MobieTrain, to create, remove and update the users.

What do we need from the client?

We need to have the following details from the clients' Afas GetConnector (the endpoint will be used by our integration to retrieve the employees' information):

  • Install MobieTrain’s GetConnector, that will be provided. Then provide:

  • API Server It should be something like this: https://<afas-online-member>.rest.afas.online/ProfitRestServices

  • Endpoint path It should be the path to the GetConnector (the name of the GetConnector is the last part of it). It can be something like this: /connectors/Mobietrain_Employees This is the one in use for our acceptance environment, where the Mobietrain_Employees is the name of the GetConnector. But it can be something else, because the client may want to build/customize their connector instead of using the one we provided.

  • Token This is the token that will allow us to make the requests to the GetConnector. It is an XML and should look something like this: <token><version>1</version><data>5741A8D1SDF98D7F87EHFD8WEH78FH97293JHD8237E9A52F49A48C144E5241812JH829C82387432A91</data></token>

F.A.Q.

  • Can the employees use Afas to login into MobieTrain (SSO)? No. This is a limitation by Afas, that can’t be used as an IDP (ID Provider).

  • Can a user be invited before his starting date? Yes, this can be setup together with your customer success manager. You as an admin can decide how many days before the actual start date the users will receive the invitation email.

  • Are the changes made by a user in MobieTrain reflected in AFAS? No. AFAS is considered the “source of truth” and every information is updated in the MobieTrain system from AFAS. For example, if a user changes his name in MobieTrain, this will be overwritten by the information existing in AFAS, in less than 24 hours, when the sync process runs.

  • Can I assign Users to User Groups manually? You shouldn’t. That information will be overwritten. AFAS is what we consider the source of truth, so every day, when we sync the users’ information, the user groups coming from AFAS will be the ones that will be assigned to the users.

  • Is it possible to test the integration with just a subset of users? Yes. The AFAS integration is based in a GetConnector that is setup in the AFAS clients’ accounts. The client can apply a filter to this connector that will make sure that only a subset of users can be invited. If you have any questions on how to configure this, please contact your AFAS manager.

Setting up the MobieTrain/AFAS GetConnector

Ask for the GetConnector file to your Client Success Manager (Mobietrain_Employees.gcn.

1. Import the GetConnector

In the AFAS Profit portal:

  1. In the search box search for “GetConnector” and click on the first suggestion that appears.Or, go to “General” > “Output” > “Management” > “GetConnector”.

  2. Click on the button “More actions” and after that click on the “Import” option.

  3. On the import dialog, click on “File”.

  4. This will open a window to select the GetConnector file (.gcn). If you don't have it, ask your MobieTrain Customer Success Manager for it.

  5. Once the file is selected you just need to follow the steps of the dialog by clicking the “Finish” button two times.

  6. To confirm that this was done successfully, you can filter the table by the name “MobieTrain” and the GetConnector should be a part of the results.

2. Setup AFAS App Connector

After having the GetConnector configured you need to setup an App Connector for the MobieTrain integration, which will allow the user synchronization process to retrieve the employees' information from AFAS.

  1. In the search box search for “App Connector” and click on the first suggestion that appears.

    Or, go to “General” > “Management” > “App Connector”.

  2. Create on the “New” button, to create a new App Connector for the MobieTrain integration with AFAS.

  3. Give it a description and a new user group name. Suggestion, it can be something like:

    1. Description: “MobieTrain AFAS App Connector”

    2. User group: “MobieTrain”

  4. Click “Next”.

  5. On the next step to define the GetConnectors associated with the App Connector we need to pick the GetConnector created before.

    1. Click on “New”.

    2. On the table presented, you can filter it by “MobieTrain” on the Definition column and pick the right one.

    3. Click “Finish”.

    4. Click “Next”.

  6. On the next step we don’t need to associate any UpdateConnector, so we can skip it. Simply click “Finish”.

  7. Once this is completed you have the App Connector defined and we just need to create the token.

  8. Go to “User tokens” and click on the “New” button to create a new token.

  9. On the “User” select the user group created before.

  10. For the description you can use something like: “User token to be used by MobieTrain integration”.

    So that you know in the future why this token was created.

  11. After both fields are ok you can click “Next” and a token will be generated and presented to you.

  12. Copy it and paste it somewhere since you won’t be able to see its value anymore. This value should be provided to MobieTrain.

  13. Simply “Finish” this App Connector configuration and it should be ready to go.

3. Check GetConnector and token

Once both the GetConnector and App Connector are configured you can easily check if everything is ok before providing the needed details to MobieTrain.

  1. On the “AFAS Online member nr” place your member number.

  2. Select “Production” on the “Environment type”.

  3. “Authentication type” leave it as “Token authorization”.

  4. Finally, on the “Token authorization” paste the token that was previously generated configuring the App Connector.

  5. Click on “Login with token”.

  6. If everything is ok you should now be authenticated and be able to select the GetConnector.

  7. From the dropdown select the GetConnector that we previously created.

  8. After that, you can check that the GetConnector is working by simply clicking on the “Execute” button and checking that the employees' data is rendered below, meaning that MobieTrain will be able to retrieve data using the GetConnector.

  9. Also, take a look at the URL section. It should look something like this:

    https://<member-nr>.rest.afas.online/ProfitRestServices/connectors/<GetConnector>

    Where <member-nr> is your member number on AFAS, and <Get_Connector> is the name of the GetConnector (Mobietrain_Employees if you use ours).

    Split this URL in two different parts:

    API Server: https://<member-nr>.rest.afas.online/ProfitRestServices

    Endpoint path: /connectors/<GetConnector>

4. Return information to MobieTrain

After checking that everything is ok, you’ll need to provide MobieTrain with the following 3 values:

  • API Server;

  • Endpoint path, and

  • Token.

Configuring a Custom GetConnector

If you don’t plan to use MobieTrain GetConnector we can still make the integration work with your custom integration. However, keep in mind that some fields are mandatory and should be provided by the GetConnector, otherwise the integration won’t work.

Field

Type

Required

Notes

email

string

✔️

employerId

string

employerName

string

employementEndDate

date

✔️

null is also accepted.

employmentStartDate

date

✔️

externalId

string

✔️

firstName

string

✔️

functionId

string

functionDescription

string

lastName

string

✔️

organizationId

string

organizationName

string

isoCode

string

null is also accepted.

It's also important to keep in mind that some fields are optional but are still important.

  • functionId and functionDescription are used to create groups on MobieTrain and associate the users to them. This can be useful to filter the access of some users to specific learning content on MobieTrain if you wish.

  • Furthermore, functionDescription is used to retrieve the job description of a user.

  • organizationId and organizationName are used to create stores on MobieTrain and associate the users to them.

  • The isoCode should return a 2 letter code that will be made into the user’s language. All communication with the user will be made in that language. If the language that is returned to MobieTrain doesn’t exist in the App, it will default to English. Also, if the user changes his language on his profile, in MobieTrain, that language will be kept. Value examples: EN, PT, DE, ES...

Did this answer your question?