Getting 400 error while accessing aikaan apis

Sir,
The APIs used in aikaan, I tried to access but Iam facing issues in Auth and moreover what ever API I try…I get the 400 error status code. Is there any way through which it can be resolved and can get a successful (200).
The problem Iam facing is,for the given API POST/API/_external/auth/v1/ signin when I try to access it from terminal as well as browser. The response Iam getting is 404. I have attached the response i have got below:


Hi,

You need to pass the login credentials for signin.
The API is correct “api/_external/auth/v1/signin”
This is post method, accepts credentials as the body. Please have a look at small script below. Please fill $controllerlogin and $controllerpassword

req_body=$(cat << EOF
{
    "name":"$controllerLogin",
    "email":"$controllerLogin",
    "password":"$controllerPassword"
}

EOF

LOGIN_API=https:/experience.aikaan.io/api/_external/auth/v1/signin
resp=curl -s -k $LOGIN_API -d "$req_body"
echo $resp

hi,
i went through the script that you have sent me and its working. but wen i try it in python script, iam getting “bad request” and i was using basic authentiacation( HTTPBasicAuth). In the api page ,in POST[​/api​/_external​/auth​/v1​/signin] , body part, there is token. So wat type of authentication is being used ?

Hi Neelima,

For signin there is no authentication. Here is a python code snippet. You need to define contUser, contPassword, contURL to appropriate value

          myobj = {"email": self.conf["contUser"],"password": self.conf["contPassword"]}
            loginURL = self.conf["contURL"] + "/api/_external/auth/v1/signin"
            #TODO: try catch
            x = requests.post(loginURL, data = json.dumps(myobj))
            #store jwt token(cookie), if success
            self.conf["jwtToken"] = x.json()["data"]["token"]
            self.cookies["aicon-jwt"] = self.conf["jwtToken"]