---
# System prepended metadata

title: User Registration APIs

---

# User Registration APIs

## Add User:

**POST** /expresso/mandir/api/users/signup.php HTTP/1.1
Host: trell.co
Content-Type: application/json

Request
```https://hackmd.io/new
{
    "username":"jungle safari",
    "contactNumber":"8772245514",
    "deviceId":"donkey_around_again",
    "referralId":"BF14AA1"
}
```
Response
```https://hackmd.io/new
{
    "success": true,
    "message": "0 transaction(s) added",
    "userSummary": {
        "userId": "50",
        "mobile": "+917506575335",
        "userAvatar": "https://cdn.trell.co/images/mandir/profile/50_1594472104730.jpg",
        "username": "Harsh Gupta",
        "isProfileComplete": true,
        "coinSummary": {
            "currentStreakStartDate": "2020-07-12",
            "currentStreakDuration": "2",
            "currentStreakEndDate": "2020-07-13",
            "coinBalance": "24",
            "levelId": "4",
            "levelName": "तृतीय चक्र",
            "levelTarget": "21",
            "levelImageUrl": "https://cdn.trell.co/images/mandir/coinLevels/3.png"
        },
        "walletBalance": 0,
        "cards": []
    }
}
```
---


## Add Profiles:

**POST** /expresso/mandir/api/users/astroProfile.php HTTP/1.1
Host: trell.co
Content-Type: application/json


Request
```https://hackmd.io/new
{
    "userId": 101,
    "profileName":"Harsh Gupta",
    "date": 10,
    "month":11,
    "year": 1995,
    "hour": 2,
    "minute": 23,
    "latitude": 19.132,
    "longitude": 72.342,
    "timezone": 5.5,
    "resourceName":"astro_details"
}
```
Response
```https://hackmd.io/new
{
    "success": true,
    "message": "new profile registered",
    "profileId": 2
}
```
---


## Get Profiles:

**GET** /expresso/mandir/api/users/astroProfile.php?userId=101 HTTP/1.1
Host: trell.co

Request
```
userId: string or int
```
Response
```https://hackmd.io/new
{
    "success": true,
    "profiles": [
        {
            "id": "1",
            "userId": "101",
            "profileName": "Harsh Gupta",
            "latitude": "19.132",
            "longitude": "72.342",
            "timezone": "5.5",
            "createdAt": "2020-05-22 13:56:19",
            "updatedAt": "2020-05-22 13:56:19",
            "date": "10",
            "month": "11",
            "year": "1995",
            "hour": "2",
            "minute": "23"
        },
        {
            "id": "2",
            "userId": "101",
            "profileName": "Harsh Gupta",
            "latitude": "19.132",
            "longitude": "72.342",
            "timezone": "5.5",
            "createdAt": "2020-05-22 13:56:28",
            "updatedAt": "2020-05-22 13:56:28",
            "date": "10",
            "month": "11",
            "year": "1995",
            "hour": "2",
            "minute": "23"
        }
    ]
}
```
---



## Get Card Structure: (Personal & Matching)

**GET** expresso/mandir/api/panditKaksh/resource.php?job=getCards HTTP/1.1
Host: trell.co

Response
```https://hackmd.io/new
{
    "success": true,
    "cards": [
        {
            "cardId": "1",
            "cardName": "अंक ज्योतिष",
            "cardDescription": "आपका शुभ नंबर, दिन, रंग, आदि जानिए",
            "isVisible": true,
            "cardType": "personal",
            "tabs": [
                {
                    "tabId": "1",
                    "tabName": "numero_table",
                    "resourceName": "numero_table",
                    "isVisible": true
                },
                {
                    "tabId": "2",
                    "tabName": "numero_report",
                    "resourceName": "numero_report",
                    "isVisible": true
                },
                {
                    "tabId": "3",
                    "tabName": "numero_fav_time",
                    "resourceName": "numero_fav_time",
                    "isVisible": true
                },
                {
                    "tabId": "4",
                    "tabName": "numero_place_vastu",
                    "resourceName": "numero_place_vastu",
                    "isVisible": true
                },
                {
                    "tabId": "5",
                    "tabName": "numero_fasts_report",
                    "resourceName": "numero_fasts_report",
                    "isVisible": true
                },
                {
                    "tabId": "6",
                    "tabName": "numero_fav_lord",
                    "resourceName": "numero_fav_lord",
                    "isVisible": true
                },
                {
                    "tabId": "7",
                    "tabName": "numero_fav_mantra",
                    "resourceName": "numero_fav_mantra",
                    "isVisible": true
                }
            ]
        }
    ]
}
```
---



## Get Tab Resource: (Personal)

**POST** /expresso/mandir/api/client/resource.php HTTP/1.1
Host: trell.co
Content-Type: application/json

Request
```https://hackmd.io/new
{
    "userId": 101,
    "profileId":1,
    "date": 10,
    "month":11,
    "year": 1994,
    "hour": 2,
    "minute": 23,
    "latitude": 19.132,
    "longitude": 72.342,
    "timezone": 5.5,
    "resourceName":"astro_details"
}
```
Response
```https://hackmd.io/new
{
    "success": true,
    "inserted": false,
    "html": "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0'><meta charset=\"UTF-8\"><div class=\"container-fluid\">    <div>        <h2 id='dataTitle'>astro_details</h2>    </div></div>"
}
```
> []Note: : inserted is false when resource has been called before
---

## Get Tab Resource: (Matching)

**POST** /expresso/mandir/api/client/resource.php HTTP/1.1
Host: trell.co
Content-Type: application/json

Request
```https://hackmd.io/new
{
    "userId": 101,
    "profileId":1,
    "date": 10,
    "month":11,
    "year": 1994,
    "hour": 2,
    "minute": 23,
    "latitude": -19.132,
    "longitude": 72.342,
    "timezone": -8,
    "profileId_2":2,
    "date_2": 10,
    "month_2":11,
    "year_2": 1994,
    "hour_2": 2,
    "minute_2": 23,
    "latitude_2": -19.132,
    "longitude_2": 72.342,
    "timezone_2": -8,
    "resourceName":"match_birth_details"
}
```
> []Note: : Will check for profileId_2 ('not-empty' AND 'not-null' AND 'is-declared') to determine if its a matching resource call.
> []Note: :First is Male, Second is Female.

Response
```https://hackmd.io/new
{
    "success": true,
    "inserted": false,
    "html": "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0'><meta charset=\"UTF-8\"><div class=\"container-fluid\">    <div>        <h2 id='dataTitle'>astro_details</h2>    </div></div>"
}
```
> []Note: : inserted is false when resource has been called before
---

## Get Geo Details:

**GET** expresso/mandir/api/panditKaksh/resource.php?startsWith=ind&maxRows=6&job=getPlace HTTP/1.1
Host: trell.co



Request
```https://hackmd.io/new
startsWith string
maxRows int
```
Response
```https://hackmd.io/new
{
    "places": [
        {
            "place_name": "Inda Silase",
            "latitude": "14.10307",
            "longitude": "38.28289",
            "country_code": "ET",
            "timezone": 3
        },
        {
            "place_name": "Indaial",
            "latitude": "-26.89778",
            "longitude": "-49.23167",
            "country_code": "BR",
            "timezone": -3
        }
    ],
    "success": true
}
```
---