New API available - faster and more powerful!

Check it out!
Perfect Gym api
Deprecated - API v1 will be switched off on 01.07.2022. Please upgrade to API v2

Adding lead

Lead is a person who is potentially interested in a given product or service. This API allow to add new lead

Add new lead alt text

POST Crm/Lead

Request creates new user and adds it to your company user's list.

Body parameters

Name Type Description
firstName string Lead first name.
lastName string Lead last name.
secondName string Lead second name.
sex string Lead sex.
Possible values:
  • Male
  • Female
email string Lead email address.
phone string Lead phone number.
rating int Lead rating Possible values: (1,2,3).
zipCode string Lead zip code.
address string Lead address.
birthDate dateTime Lead birth date.
clubId long Club identifier.
sourceId long Source identifier.
referralId long Recommending club memeber identifier.
consultantId long Lead consultant identifier.
phoneMarketingAgreement bool Consent to telephone contact.
agreement array An array of Agreement objects.

Fields requirements depends on system settings

Example request

In this example we add new lead with some sample data.


curl -X POST 
     -H "Authorization: Bearer $ACCESS_TOKEN" 
     -H "Content-Type: application/json" 
     -d '{
        "firstName": "John",
        "lastName": "Fibo",
        "email": "john.fibo@perfectgym.pl",
        "phone": "0048123456789",
        "birthDate": "1978-06-01T00:00:00",
        "clubId": 10,
        "sourceId": 1,
        "phoneMarketingAgreement": true     
    }' 
    http://yoursubdomain.perfectgym.com/Api/Crm/Lead

Get lead sources

GET Crm/Lead/Sources

Get lead source defined by dictionary.

Example request

In this example we get information about leas sources.


curl -i 
     -X GET 
     -H "Authorization: Bearer $ACCESS_TOKEN" 
     -H "Content-Type: application/json"
     
    http://yoursubdomain.perfectgym.com/Api/Crm/Lead/Sources

Example response

Status: 200 OK
{
  "elements": [
    {
      "id": 2,
      "name": "MarketingCampaign",
      "description": "MarketingCampaign"
    },
    {
      "id": 3,
      "name": "WalkIn",
      "description": "WalkIn"
    }
  ]
}

Get lead agreements

GET Crm/Lead/Agreements

Get agreements to present to a potential customer.

Response

Agreement types.

Example request

In this example we get information about types of agreements.


curl -i 
     -X GET  
     -H "Authorization: Bearer $ACCESS_TOKEN" 
     -H "Content-Type: application/json"
     
    http://yoursubdomain.perfectgym.com/Api/Crm/Lead/Agreements

Example response

Status: 200 OK
{
  "elements": [
    {
      "id": 2,
      "name": "Newsletter",
      "description": "Newsletter"
    }
  ]
}
Perfect Gym api