Back to documentation

Release notes version 1.2 version1.2

Visits


new GetVisitById    New in 1.2

Retrieves a visit.

Syntax
JSON example


$.ajax({
    type: 'GET',
    url: 'https://api.cavvisit.com/api/Visits/GetVisitById',
    data: { customerKey: "123456789", customerId: "1", id:"1" },
    dataType: 'json',
    success: function (data) {},
    error: function (request, message, error) {}
});


Parameters

string customerKey
The string representing the unique web key of the customer in the database.

int customerId
The int representing the unique ID of the customer in the database.

int id
The int representing the unique ID of the visit in the database.

Return value

Type: List<Visit>
A list of visits information.


 

new CreateGroupVisit    New in 1.2

Creates a group visit.

Syntax
JSON example

    
var visitors = [{ VisitorName: "Person 1", VisitorCompany: "VCompany 1", MobilePhone: "000001", Email: "001@001.se", Field1: "field 1 p1", Field2: "field 2 p1" },
                { VisitorName: "Person 2", VisitorCompany: "VCompany 2", MobilePhone: "000002", Email: "002@002.se", Field1: "field 1 p2", Field2: "field 2 p2" },
                { VisitorName: "Person 3", VisitorCompany: "VCompany 3", MobilePhone: "000003", Email: "003@003.se", Field1: "field 1 p3", Field2: "field 2 p3" }
];

var GroupVisit = JSON.stringify({
    Host: "1", Notes: "Group API Notes", Location: "Group location", GroupName: "Group name Hello",
    Place: "Stockholm", Subject: "My subject test API", Organizer: "Organizer API",
    DateVisit: "2023-05-25T05:15:00Z", DateValidTo: "2023-05-25 22:00", Visitors: visitors
});

$.ajax({
    type: 'POST',
    url: 'https://api.cavvisit.com/api/Visits/CreateGroupVisit',
    data: {customerKey: "1234567891", customerId: "1", GroupVisit},
    dataType: 'json',
    success: function (data) {},
    error: function (data) {}
});


Parameters

string customerKey
The string representing the unique web key of the customer in the database.

int customerId
The int representing the unique ID of the customer in the database.

GroupVisit GroupVisit
A visit object.

Return value

Type: string
The GroupId of the created group.


 

new UpdateGroupVisit    New in 1.2

Updates a group visit.

Syntax
JSON example


var GroupVisitInfo = JSON.stringify({
    GroupId:"1E4F3283-8309-4FD4-BG69-73448F8C5C4E"
    Host: "1", Notes: "Group API Notes", Location: "Group location", GroupName: "Group name Hello",
    Place: "Stockholm", Subject: "My subject test API", Organizer: "Organizer API",
    DateVisit: "2023-05-25T05:15:00Z", DateValidTo: "2023-05-25 22:00"
});

$.ajax({
    type: 'PUT',
    url: 'https://api.cavvisit.com/api/Visits/UpdateGroupVisit',
    data: {customerKey: "1234567891", customerId: "1", GroupVisitInfo},
    dataType: 'json',
    success: function (data) {},
    error: function (data) {}
});


Parameters

string customerKey
The string representing the unique web key of the customer in the database.

int customerId
The int representing the unique ID of the customer in the database.

GroupVisitInfo GroupVisitInfo
A groupvisitinfo object.

Return value

Type: string


 

new DeleteGroupVisit    New in 1.2

Deletes a group visit.

Syntax
JSON example


$.ajax({
    type: 'DELETE',
    url: 'https://api.cavvisit.com/api/Visits/DeleteGroupVisit',
    data: {customerKey: "123456789", customerId: "1", groupId: "9E4F3383-8409-4FD4-BE69-73478F8C6C4A"},
    dataType: 'json',
    success: function (data) {},
    error: function (request, message, error) {}
});


Parameters

string customerKey
The string representing the unique web key of the customer in the database.

int customerId
The int representing the unique ID of the customer in the database.

string groupId
The string representing the Group ID of the group visit in the database.


new AddVisitToGroup    New in 1.2

Adds a visit to a group visit.

Syntax
JSON example


var Visitor = JSON.stringify({
    GroupId: "98B371AE-9EC1-4243-B6D5-358F658CFA29", VisitorName: "API person3", VisitorCompany: "API Company", MobilePhone: "070752566",
    Email: "email@api.se", Field1: "API Field1", Field2: "API Field2",
    Cfield1: "True" });

$.ajax({
    type: 'POST',
    url: 'https://api.cavvisit.com/api/Visits/AddVisitToGroup',
    data: {customerKey: "123456789", customerId: "1", Visitor},
    dataType: 'json',
    success: function (data) {},
    error: function (request, message, error) {}
});


Parameters

string customerKey
The string representing the unique web key of the customer in the database.

int customerId
The int representing the unique ID of the customer in the database.

Visitor Visitor
A visitor object.


new UpdateVisitInGroup    New in 1.2

Updates a visit in a group visit.

Syntax
JSON example


var Visitor = JSON.stringify({
    GroupId: "98B371AE-9EC1-4243-B6D5-358F658CFA29", VisitorName: "API person3", VisitorCompany: "API Company", MobilePhone: "070752566",
    Email: "email@api.se", Field1: "API Field1", Field2: "API Field2",
    Cfield1: "True" });

$.ajax({
    type: 'PUT',
    url: 'https://api.cavvisit.com/api/Visits/UpdateVisitInGroup',
    data: {customerKey: "123456789", customerId: "1", Visitor},
    dataType: 'json',
    success: function (data) {},
    error: function (request, message, error) {}
});


Parameters

string customerKey
The string representing the unique web key of the customer in the database.

int customerId
The int representing the unique ID of the customer in the database.

Visitor Visitor
A visitor object.

Return value

Type: string


 

new DeleteVisitFromGroup    New in 1.2

Deletes a visit from a group visit.

Syntax
JSON example


$.ajax({
    type: 'DELETE',
    url: 'https://api.cavvisit.com/api/Visits/DeleteVisitFromGroup',
    data: {customerKey: "123456789", customerId: "1", id: "1"},
    dataType: 'json',
    success: function (data) {},
    error: function (request, message, error) {}
});


Parameters

string customerKey
The string representing the unique web key of the customer in the database.

int customerId
The int representing the unique ID of the customer in the database.

int id
The int representing the unique ID of the visit in the database.


GroupVisit

A class representing the group visit information.

Syntax


class GroupVisit
{
    string GroupId
    int Host
    string HostName (read only)
    DateTime DateVisit
    DateTime DateValidTo
    string Notes
    string Location
    string GroupName
    string Subject
    string Organizer
    List Visitors
}



GroupVisitInfo

A class representing the GroupVisitInfo information.

Syntax


class GroupVisitInfo
{
    string GroupId
    int Host
    string HostName (read only)
    DateTime DateVisit
    DateTime DateValidTo
    string Notes
    string Location
    string GroupName
    string Place
    string Subject
    string Organizer
}


Visitor

A class representing the visitor information.

Syntax


class Visitor
{
    int Id
    string GroupId
    string VisitorName
    string VisitorCompany
    string MobilePhone
    string Email
    string Field1
    string Field2
    string Field3
    string Field4
    string Field5
    string Field6
    string Field7
    string Field8
    string Field9
    string Field10
    bool Cfield1
    bool Cfield2
    bool Cfield3
    bool Cfield4
    bool Cfield5
    bool Cfield6
    bool Cfield7
    bool Cfield8
    bool Cfield9
    bool Cfield10
    bool Cfield11
    bool Cfield12
    bool Cfield13
    bool Cfield14
    bool Cfield5
    string QrCode
}