Need the credentials

Hi ,
Can you help me in providing the credentials ( parameters) for the below screenshot…Screenshot from 2020-10-16 15-48-53

Description

These are the parameters you have to pass to the API used for downloading the aiagent install script.

Details

userid: ID assigned to your account.
Eg. 7f645e2e-c449-4bba-8e62-2686eba03299

dgpid: ID of the device group you want to add the device to.
Eg. 511c8133-5499-4a90-8298-8faef906faff

package_type: You can select one of the two types of packages:

  1. docker
  2. ipkg

install_dir (optional): Directory you want to install the aiagent in.
E.g. /etc

config_dir (optional): Directory you want to put your aiagent config in. The contents of this directory remains the same across installation/upgrades.
Eg. /etc

Example

So if you are logged in with sabu@benlycos.com and want to add a device to the Default device group, you can get the script by running the following:

curl -sfkL 'https://experience.aikaan.io/api/_external/img/v1/user/7f645e2e-c449-4bba-8e62-2686eba03299/dgp/511c8133-5499-4a90-8298-8faef906faff/fwshellscript?package_type=ipkg&install_dir=/etc&config_dir=/etc'

Let me know if you need any further details.

Thanks!

1 Like

hi,
Thank you sir… this is working :smile:
sir, do we have to add cookies to the api request inorder to access them,
eg: GET​/um​/api​/dgp​/v1​/dgp​/,do i need to add cookies in order to access the response content of this api?

Hey, sorry for the delayed response.

Yes, you need to set a cookie called aicon-jwt . Firstly, you use the signin API to get a token.

The API is “api/_external/auth/v1/signin”

This is the post method, accepts credentials as the body. Please have a look at the small script below.

req_body=$(cat << EOF
{
name":"sabu@benlycos.com”,
email":"sabu@benlycos.com”,
“password”:“MyPassword”
}
EOF

LOGIN_API=https:/experience.aikaan.io/api/_external/auth/v1/signin

resp=`curl -s -k $LOGIN_API -d “$req_body”`

The response (echo $resp) would look like:

{
  "respcode": 0,
  "respmsg": "SUCCESS",
  "data": {
    "userid": "7f645e2e-c449-4bba-8e62-2686eba03299",
    "email": "sabu@benlycos.com",
    "token": "eyJhb354NiIsInR5ASDfaSFAFSDCJ9.eyJjbGllbnRpZCI6ImUxNWJhMmNlLTgyY2UtNDIyOS1hZmRkLThkNDgxZTY5MaSDASFSFASMTYwNDQwMzA5MCwiaXNzIjoibDJEM05KT043TFIzNkpITGk0QUxaWlJRbno2dVZ3eVYifQ.fNhVtstrAdg-aSDSaae59bgVwiuVtlyQH2H-k",
    "firstlogin": 1,
    "acctype": 0
  }
}

Now when you call any API’s, you take the “token” from here and plug it in your request as a cookie header like :

Cookie: aicon-jwt=eyJhb354NiIsInR5ASDfaSFAFSDCJ9.eyJjbGllbnRpZCI6ImUxNWJhMmNlLTgyY2UtNDIyOS1hZmRkLThkNDgxZTY5MaSDASFSFASMTYwNDQwMzA5MCwiaXNzIjoibDJEM05KT043TFIzNkpITGk0QUxaWlJRbno2dVZ3eVYifQ.fNhVtstrAdg-aSDSaae59bgVwiuVtlyQH2H-k
1 Like