Here at DACCAA, we love developers.
We have updated the API to V 2.1 which is an update from 2.0. Whilst this is considered a minor update, you will need to change code on your end if you use the API. We have simplified the API process to make sure that you don't need to complete unnecessary steps.
The login button
To make your login button you need to create a link to https://daccaa.com/gateway/v2/. Now this is where the change is from the last version, you must specify where you want the user to be redirected back to such as https://daccaa.com/gateway/v2/?redirect_uri=https://daccaa.com/login_process.php, of course this replaces the need for the accept directory however you could easily just have the redirect_uri set to your accept directory.
What does this return?
When we send the user back to your site we will append the following information to the redirect_uri: ?success=true&id=Member ID&email=Email. Now if you application only needs an email address then this is fine and you can stop there. However if you wish to gain more information you will need to apply for an API key using the "My Key" link above.
Getting more information
If you want more information from DACCAA like the users name or profile picture then you need to make a full API request using a key. Luckily your user will have provided you with permission to access their account and you now have their email address and their member id. If you make an API request to DACCAA with that information we will provide you with the rest of the information you require. Make sure you store the email address and member id.
How do I make a request?
Making an API request to DACCAA is extremely simple and if you have ever made an API request before this should be very straight forward. So what information do we provide? We provide the information listed in the table below:
|id||The ID (unique) that we assign each user.|
|We will also send the users email.|
|fname||The users first name, this works of a full name explosion where the first space is found.|
|sname||This is the users surname, it can contain a middle name or a double barrel name.|
|sbImage||This is for use with the DACCAA Sidebar as it provides information on the image used.|
|effect||This is for use with the DACCAA Sidebar as it provides information on the effect used.|
|banned||The status of whether the account is currently banned or not. If it is it is your discretition wether to allow them to login or not.|
|profile||The link to the profile picture (returned with \ to break slashes.)|
You must make your requests to https://daccaa.com/gateway/.
For example: https://firstname.lastname@example.org&id=22&type=normal.
A list of all excepteded variables are listed below, when we say first request we mean when the user has to enter there password, all future requests (second request) do not require the users password.
|This is the users email email@example.com||yes|
|type||This is the type of login.||normal||yes|
|id||This is the users id.||01||yes|
You will need to obtain a key to make requests.
You should store the id and email address for future requests.
Thoughts and implementations
Before we get onto any examples, I would like to take this time to discuss applications for the use of the DACCAA API as there has been several different examples where people have found use for the DACCAA API. Here are just some examples:
- Login with DACCAA (see below)
- An autofill method for information - DACCAA makes sharing your information seemless so it is easy to create a autofill with DACCAA button.
- Contact using DACCAA information
Login with DACCAA
I want to spend some time elaborating on the login with DACCAA method as it was designed with a certain focus in mind. The user flow would be something like:
- The user visits your website
- The user clicks either login or register
- The user sees the login with DACCAA button (on both register and login page)
- The user clicks the button and is sent to the authorisation page (as they are already logged in - likely as DACCAA remembers them)
- The user then clicks "authorise" and is taken back to your site
Now lets stop there because this is where the system ideology starts to form.
If the user has an account but has not associated it with their DACCAA account then this process would make the association and then log them in.
If the user has an account that has been associated then it will just log them in.
If the user has never visited this website before then an account is created and the associated is made - the user has the oppertunity to create a password later on or just use DACCAA to login everytime - usernames can also be generated by using hashed emails or any value you like which is then shortened and added to their firstname.)
So what are we checking when we say they already have an account? We are checking the email addresses, we make the assumption that as DACCAA verifies all email addresses and has options for 2FA (two factor authentication) then we will be pretty sure that the person we are sending over to you is the person who it is meant to be.
Brand Values and Rules
As you may expect we have certain values and expectations for the usage of our members system. You must do the following:
- Always contain the on any form that is a login form for DACCAA. https://daccaa.com/search/letter_d.png
- You can place buttons with the following, "Login with DACCAA", "Autofill with DACCAA" or "Register with DACCAA".
- Any button that uses the API must be styled like so:
Login with DACCAA
- Do not place anything on the login in page that suggests that it is not linked to DACCAA.
- Do not state that DACCAA is a partner/sponsor or any other non such affiliate.
- Always include a link to the DACCAA sign up page. https://daccaa.com/login/register.php
- You may use the DACCAA hex colours: #0099cc and #006699.
- You may also use the marketing "Works with DACCAA" image (https://daccaa.com/aa/share.php?member=49&id=302&code=1611955315&access=899335790).
This is some important code for your homepage. This includes understanding the errors that DACCAA may return. Below is some basic code that you may want to head your index page with (or where ever the login button is).
Index Page - error handling:
This is an example of the PHP code you will need to store in the accept directory. This code allows you to make a request to the server. Please note that this code does not consider any security at all which we recommend you use.
PHP processing code:
Logging you in now.'; echo '';
Did we make a mistake? Do you think there is any vulnerabilites with this? Or are you still confused? Then get in touch with us and we will aim to reply with 48 hours for the quickest support possible.contact us