Dokumentation för API-funktioner
GET BusinessIntelligence/TipsAndLeads/Report Hämtar en rapport över skickade och mottagna tips och leads, datumintervallet får inte överstiga två månader Request Information URI Parameters
NamnBeskrivningTypInformation
customerId Kund-id string Krävs
dateFrom Från date Krävs
dateTo Till date Krävs
activeStatusTipLead Aktiv status ActiveStatusTipLead

Response Information Resource Description Hämtar en rapport över skickade och mottagna tips och leads, datumintervallet får inte överstiga två månader TipsAndLeadsReport
NamnBeskrivningTypInformation
IncomingLeads Inkommande leads Collection of IncomingLead

OutgoingLeads Utgående leads Collection of OutgoingLead

Tips Tips mellan kollegor Collection of SentTip

Kodexempel

curl "https://connect.maklare.vitec.net/BusinessIntelligence/TipsAndLeads/Report?customerId=StringValue&dateFrom=2015-01-01T12:00:00&dateTo=2015-01-01T12:00:00&activeStatusTipLead=Active" -X GET -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" 
            

$URL = "https://connect.maklare.vitec.net/BusinessIntelligence/TipsAndLeads/Report?customerId=StringValue&dateFrom=2015-01-01T12:00:00&dateTo=2015-01-01T12:00:00&activeStatusTipLead=Active"
Invoke-WebRequest -Uri $URL -Method GET -Headers @{"authorization" = "basic {Base64 kodad användarnamn och lösenord}"} 
                

// HttpClientInstance ska deklareras som en singleton
// public static readonly HttpClient HttpClientInstance = new HttpClient {
//     BaseAddress = new Uri("https://connect.maklare.vitec.net"),
//     DefaultRequestHeaders = {
//         Authorization = new AuthenticationHeaderValue("Basic", "{Base64 kodad användarnamn och lösenord}")
//     }
// }
using (var response = await HttpClientInstance.GetAsync("BusinessIntelligence/TipsAndLeads/Report?customerId=StringValue&dateFrom=2015-01-01T12:00:00&dateTo=2015-01-01T12:00:00&activeStatusTipLead=Active")) {
    if (response.StatusCode == HttpStatusCode.Unauthorized) {
        // Authorization headern är inte korrekt
    }
    if (response.StatusCode == HttpStatusCode.Forbidden) {
        // Begärt data som det saknas åtkomst till
    }
    if (response.StatusCode == HttpStatusCode.InternalServerError) {
        // Oväntat fel, kontakta Vitec
    }
    if (response.StatusCode == HttpStatusCode.BadRequest) {
        var json = await response.Content.ReadAsStringAsync();
        var result = JsonConvert.DeserializeObject<dynamic>(json);
        // Hantera valideringsfel, presenteras i resultatet
    }
    
    var json = await response.Content.ReadAsStringAsync();
    // JsonConvert finns i biblioteket Newtonsoft.Json
    var result = JsonConvert.DeserializeObject<dynamic>(json);
    
    var incomingLeads = result.incomingLeads.Value;
    // TODO: Gör något med resultatet
}

$URL = "https://connect.maklare.vitec.net/BusinessIntelligence/TipsAndLeads/Report?customerId=StringValue&dateFrom=2015-01-01T12:00:00&dateTo=2015-01-01T12:00:00&activeStatusTipLead=Active";

$ch = curl_init();

curl_setopt($ch, CURLOPT_USERNAME, "{Användarnamn}");
curl_setopt($ch, CURLOPT_PASSWORD, "{Lösenord}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);

$result = curl_exec($ch);

if (curl_errno($ch)) {
    die(curl_getinfo($ch));
}

$info = curl_getinfo($ch);
curl_close($ch);

$http_code = $info["http_code"];
if ($http_code == 401) {
    // Användarnamnet eller lösenordet är felaktigt
}
if ($http_code == 403) {
    // Begärt data som det saknas åtkomst till
}
if ($http_code == 500) {
    // Oväntat fel, kontakta Vitec
}
if ($http_code == 400) {
    $json = json_decode($result, true);
    // Hantera valideringsfel, presenteras i $json
}

$field_on_result = $result["incomingLeads"];
// TODO: Gör något med resultatet
Testformulär Text input
Response Formats
{
  "incomingLeads": [
    {
      "createdAt": "2024-11-21T10:11:56.8635797+01:00",
      "sender": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "receiver": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "lead": {
        "id": "sample string 1",
        "title": "sample string 2",
        "type": "sample string 3",
        "state": "New",
        "message": "sample string 4"
      },
      "contact": {
        "id": "sample string 1",
        "firstName": "sample string 2",
        "lastName": "sample string 3"
      },
      "estate": {
        "id": "sample string 1",
        "estateStatus": "AssignmentAttempt",
        "status": {
          "id": 1,
          "text": "sample string 2"
        }
      }
    },
    {
      "createdAt": "2024-11-21T10:11:56.8635797+01:00",
      "sender": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "receiver": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "lead": {
        "id": "sample string 1",
        "title": "sample string 2",
        "type": "sample string 3",
        "state": "New",
        "message": "sample string 4"
      },
      "contact": {
        "id": "sample string 1",
        "firstName": "sample string 2",
        "lastName": "sample string 3"
      },
      "estate": {
        "id": "sample string 1",
        "estateStatus": "AssignmentAttempt",
        "status": {
          "id": 1,
          "text": "sample string 2"
        }
      }
    }
  ],
  "outgoingLeads": [
    {
      "createdAt": "2024-11-21T10:11:56.8635797+01:00",
      "user": {
        "id": "sample string 1",
        "name": "sample string 2",
        "type": "User",
        "employeeNumber": "sample string 3"
      },
      "sender": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "receiver": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "lead": {
        "id": "sample string 1",
        "title": "sample string 2",
        "type": "sample string 3",
        "message": "sample string 4"
      },
      "contact": {
        "id": "sample string 1",
        "firstName": "sample string 2",
        "lastName": "sample string 3"
      }
    },
    {
      "createdAt": "2024-11-21T10:11:56.8635797+01:00",
      "user": {
        "id": "sample string 1",
        "name": "sample string 2",
        "type": "User",
        "employeeNumber": "sample string 3"
      },
      "sender": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "receiver": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "lead": {
        "id": "sample string 1",
        "title": "sample string 2",
        "type": "sample string 3",
        "message": "sample string 4"
      },
      "contact": {
        "id": "sample string 1",
        "firstName": "sample string 2",
        "lastName": "sample string 3"
      }
    }
  ],
  "tips": [
    {
      "createdAt": "2024-11-21T10:11:56.8635797+01:00",
      "sender": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "receiver": {
        "id": "sample string 1",
        "name": "sample string 2",
        "employeeNumber": "sample string 3",
        "type": "User",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "tip": {
        "id": "sample string 1",
        "title": "sample string 2",
        "state": "New",
        "message": "sample string 3",
        "type": "FromUser"
      },
      "contact": {
        "id": "sample string 1",
        "firstName": "sample string 2",
        "lastName": "sample string 3"
      },
      "estate": {
        "id": "sample string 1",
        "estateStatus": "AssignmentAttempt",
        "status": {
          "id": 1,
          "text": "sample string 2"
        }
      }
    },
    {
      "createdAt": "2024-11-21T10:11:56.8635797+01:00",
      "sender": {
        "id": "sample string 1",
        "name": "sample string 2",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "receiver": {
        "id": "sample string 1",
        "name": "sample string 2",
        "employeeNumber": "sample string 3",
        "type": "User",
        "company": {
          "id": "sample string 1",
          "name": "sample string 2",
          "customerNumber": "sample string 3"
        }
      },
      "tip": {
        "id": "sample string 1",
        "title": "sample string 2",
        "state": "New",
        "message": "sample string 3",
        "type": "FromUser"
      },
      "contact": {
        "id": "sample string 1",
        "firstName": "sample string 2",
        "lastName": "sample string 3"
      },
      "estate": {
        "id": "sample string 1",
        "estateStatus": "AssignmentAttempt",
        "status": {
          "id": 1,
          "text": "sample string 2"
        }
      }
    }
  ]
}
<TipsAndLeadsReport xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.BusinessIntelligense">
  <IncomingLeads>
    <IncomingLead>
      <Contact>
        <FirstName>sample string 2</FirstName>
        <Id>sample string 1</Id>
        <LastName>sample string 3</LastName>
      </Contact>
      <CreatedAt>2024-11-21T10:11:56.8635797+01:00</CreatedAt>
      <Estate>
        <EstateStatus>AssignmentAttempt</EstateStatus>
        <Id>sample string 1</Id>
        <Status>
          <Id>1</Id>
          <Text>sample string 2</Text>
        </Status>
      </Estate>
      <Lead xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.BusinessIntelligense.Incomming">
        <d4p1:Id>sample string 1</d4p1:Id>
        <d4p1:Message>sample string 4</d4p1:Message>
        <d4p1:State>New</d4p1:State>
        <d4p1:Title>sample string 2</d4p1:Title>
        <d4p1:Type>sample string 3</d4p1:Type>
      </Lead>
      <Receiver>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Receiver>
      <Sender>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Sender>
    </IncomingLead>
    <IncomingLead>
      <Contact>
        <FirstName>sample string 2</FirstName>
        <Id>sample string 1</Id>
        <LastName>sample string 3</LastName>
      </Contact>
      <CreatedAt>2024-11-21T10:11:56.8635797+01:00</CreatedAt>
      <Estate>
        <EstateStatus>AssignmentAttempt</EstateStatus>
        <Id>sample string 1</Id>
        <Status>
          <Id>1</Id>
          <Text>sample string 2</Text>
        </Status>
      </Estate>
      <Lead xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.BusinessIntelligense.Incomming">
        <d4p1:Id>sample string 1</d4p1:Id>
        <d4p1:Message>sample string 4</d4p1:Message>
        <d4p1:State>New</d4p1:State>
        <d4p1:Title>sample string 2</d4p1:Title>
        <d4p1:Type>sample string 3</d4p1:Type>
      </Lead>
      <Receiver>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Receiver>
      <Sender>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Sender>
    </IncomingLead>
  </IncomingLeads>
  <OutgoingLeads>
    <OutgoingLead>
      <Contact>
        <FirstName>sample string 2</FirstName>
        <Id>sample string 1</Id>
        <LastName>sample string 3</LastName>
      </Contact>
      <CreatedAt>2024-11-21T10:11:56.8635797+01:00</CreatedAt>
      <Lead xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.BusinessIntelligense.Outgoing">
        <d4p1:Id>sample string 1</d4p1:Id>
        <d4p1:Message>sample string 4</d4p1:Message>
        <d4p1:Title>sample string 2</d4p1:Title>
        <d4p1:Type>sample string 3</d4p1:Type>
      </Lead>
      <Receiver>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Receiver>
      <Sender>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Sender>
      <User>
        <EmployeeNumber>sample string 3</EmployeeNumber>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
        <Type>User</Type>
      </User>
    </OutgoingLead>
    <OutgoingLead>
      <Contact>
        <FirstName>sample string 2</FirstName>
        <Id>sample string 1</Id>
        <LastName>sample string 3</LastName>
      </Contact>
      <CreatedAt>2024-11-21T10:11:56.8635797+01:00</CreatedAt>
      <Lead xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.BusinessIntelligense.Outgoing">
        <d4p1:Id>sample string 1</d4p1:Id>
        <d4p1:Message>sample string 4</d4p1:Message>
        <d4p1:Title>sample string 2</d4p1:Title>
        <d4p1:Type>sample string 3</d4p1:Type>
      </Lead>
      <Receiver>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Receiver>
      <Sender>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Sender>
      <User>
        <EmployeeNumber>sample string 3</EmployeeNumber>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
        <Type>User</Type>
      </User>
    </OutgoingLead>
  </OutgoingLeads>
  <Tips>
    <SentTip>
      <Contact>
        <FirstName>sample string 2</FirstName>
        <Id>sample string 1</Id>
        <LastName>sample string 3</LastName>
      </Contact>
      <CreatedAt>2024-11-21T10:11:56.8635797+01:00</CreatedAt>
      <Estate>
        <EstateStatus>AssignmentAttempt</EstateStatus>
        <Id>sample string 1</Id>
        <Status>
          <Id>1</Id>
          <Text>sample string 2</Text>
        </Status>
      </Estate>
      <Receiver xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.BusinessIntelligense.Tips">
        <d4p1:Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </d4p1:Company>
        <d4p1:EmployeeNumber>sample string 3</d4p1:EmployeeNumber>
        <d4p1:Id>sample string 1</d4p1:Id>
        <d4p1:Name>sample string 2</d4p1:Name>
        <d4p1:Type>User</d4p1:Type>
      </Receiver>
      <Sender>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Sender>
      <Tip>
        <Id>sample string 1</Id>
        <Message>sample string 3</Message>
        <State>New</State>
        <Title>sample string 2</Title>
        <Type>FromUser</Type>
      </Tip>
    </SentTip>
    <SentTip>
      <Contact>
        <FirstName>sample string 2</FirstName>
        <Id>sample string 1</Id>
        <LastName>sample string 3</LastName>
      </Contact>
      <CreatedAt>2024-11-21T10:11:56.8635797+01:00</CreatedAt>
      <Estate>
        <EstateStatus>AssignmentAttempt</EstateStatus>
        <Id>sample string 1</Id>
        <Status>
          <Id>1</Id>
          <Text>sample string 2</Text>
        </Status>
      </Estate>
      <Receiver xmlns:d4p1="http://schemas.datacontract.org/2004/07/Vitec.Housing.Connect.Api.Models.BusinessIntelligense.Tips">
        <d4p1:Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </d4p1:Company>
        <d4p1:EmployeeNumber>sample string 3</d4p1:EmployeeNumber>
        <d4p1:Id>sample string 1</d4p1:Id>
        <d4p1:Name>sample string 2</d4p1:Name>
        <d4p1:Type>User</d4p1:Type>
      </Receiver>
      <Sender>
        <Company>
          <CustomerNumber>sample string 3</CustomerNumber>
          <Id>sample string 1</Id>
          <Name>sample string 2</Name>
        </Company>
        <Id>sample string 1</Id>
        <Name>sample string 2</Name>
      </Sender>
      <Tip>
        <Id>sample string 1</Id>
        <Message>sample string 3</Message>
        <State>New</State>
        <Title>sample string 2</Title>
        <Type>FromUser</Type>
      </Tip>
    </SentTip>
  </Tips>
</TipsAndLeadsReport>