POST /GetAllPersons

  • HTTP Status 200

    Function returns all persons

    • id Type: integer

      Record ID


    • created_at Type: integer

      Created date


    • firstname Type: varchar

      Person firstname


    • lastname Type: varchar

      Person lastname


    • title_before_name Type: varchar

      Title before name


    • title_after_name Type: varchar

      Title after name


    • work_position Type: varchar

      Work position


    • phone1_prefix Type: varchar

      Phone 1 prefix


    • phone_1 Type: integer

      Phone 1 number


    • phone2_prefix Type: varchar

      Phone 2 prefix


    • phone_2 Type: integer

      Phone 2 number


    • email Type: varchar

      E-mail


    • company_name Type: varchar

      Company name


    • company_id Type: integer

      Company id


    • birth_number Type: varchar

      Birth number


    • disabled Type: boolean

      0 - active, 1 - disabled


    • updated_at Type: timestamp

      Updated at date


    • permission_to_send_emails Type: boolean

      0 - active, 1 - disabled


    • email_campaign_lang Type: varchar

      Person campaign language


    • unsubscribe_reason_id Type: integer

      Unsubscribe reason id


    • unsubscribe_reason_text Type: varchar

      Unsubscribe reason text


    Query Response Example

    {
        "code": 200,
        "response": [
            {
                "id": 95,
                "created_at": 1630167097,
                "firstname": "Patrik",
                "lastname": "Ulbrik",
                "title_before_name": "",
                "title_after_name": "",
                "work_position": "",
                "phone1_prefix": "SK +421",
                "phone_1": "918123456",
                "phone2_prefix": "SK +421",
                "phone_2": "",
                "email": "",
                "company_name": "CRMango s.r.o.",
                "company_id": 1120,
                "birth_number": "",
                "disabled": 0,
                "updated_at": "2024-03-10 22:14:15",
                "permission_to_send_emails": 1,
                "email_campaign_lang": "sk",
                "unsubscribe_reason_id": 0,
                "unsubscribe_reason_text": null
            },
            {
                "id": 96,
                "created_at": 1630167541,
                "firstname": "Jirko",
                "lastname": "Kusy",
                "title_before_name": "",
                "title_after_name": "",
                "work_position": "",
                "phone1_prefix": "SK +421",
                "phone_1": "724789234",
                "phone2_prefix": "SK +421",
                "phone_2": "",
                "email": "",
                "company_name": "CRMango s.r.o.",
                "company_id": 388,
                "birth_number": "",
                "disabled": 0,
                "updated_at": "2024-03-10 22:14:15",
                "permission_to_send_emails": 1,
                "email_campaign_lang": "sk",
                "unsubscribe_reason_id": 0,
                "unsubscribe_reason_text": null
            }
        ]
    }

    Error Response Example

    {
        "code": "int",
        "message": "string"
    }
  • Parameters

    Parameters that need to be sent in the request

      Authorization

    • Bearer Type: varchar

      Auth token


    • Body data

    • date_from Type: timestamp

      Date from


    • date_to Type: timestamp

      Date to


    • date_type Type: varchar

      Date type to filter data by.
      Options: created_at or updated_at


Example Request

Mac window icon
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://rest.crmango.com/api/GetAllPersons',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"date_from" => "timestamp",
"date_to" => "timestamp",
"date_type" => "varchar"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer auth_token'
'Content-Type: application/json'
),
));

$response = curl_exec($curl);

curl_close($curl);

echo $response;
chat