Trendsic Platform Service

<back to all web services

ProjectCrewRecruitsRequest

Requires Authentication
The following routes are available for this service:
GET,POST,PUT,DELETE,OPTIONS/v1/ProjectCrew/Recruits/{ProjectID}
GET,POST,PUT,DELETE,OPTIONS/v1/ProjectCrew/Recruits/Search/{Tags}
import Foundation
import ServiceStack

public class ProjectCrewRecruitsRequest : Codable
{
    public var projectID:Int
    public var tags:String

    required public init(){}
}

public class ProjectCrewMembersResponse : Codable
{
    public var responseStatus:ResponseStatus
    public var projectCrewMembers:[ProjectCrewMember] = []

    required public init(){}
}

public class ProjectCrewMember : Contact
{
    public var projectCrewContactID:Int
    public var projectID:Int
    public var crewID:Int
    public var crewRate:Double
    public var billedCrewRate:Double
    public var projectCrewID:Int
    public var status:String
    public var firstAddedDate:Date
    public var dateAddedToThisProject:Date

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case projectCrewContactID
        case projectID
        case crewID
        case crewRate
        case billedCrewRate
        case projectCrewID
        case status
        case firstAddedDate
        case dateAddedToThisProject
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        projectCrewContactID = try container.decodeIfPresent(Int.self, forKey: .projectCrewContactID)
        projectID = try container.decodeIfPresent(Int.self, forKey: .projectID)
        crewID = try container.decodeIfPresent(Int.self, forKey: .crewID)
        crewRate = try container.decodeIfPresent(Double.self, forKey: .crewRate)
        billedCrewRate = try container.decodeIfPresent(Double.self, forKey: .billedCrewRate)
        projectCrewID = try container.decodeIfPresent(Int.self, forKey: .projectCrewID)
        status = try container.decodeIfPresent(String.self, forKey: .status)
        firstAddedDate = try container.decodeIfPresent(Date.self, forKey: .firstAddedDate)
        dateAddedToThisProject = try container.decodeIfPresent(Date.self, forKey: .dateAddedToThisProject)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if projectCrewContactID != nil { try container.encode(projectCrewContactID, forKey: .projectCrewContactID) }
        if projectID != nil { try container.encode(projectID, forKey: .projectID) }
        if crewID != nil { try container.encode(crewID, forKey: .crewID) }
        if crewRate != nil { try container.encode(crewRate, forKey: .crewRate) }
        if billedCrewRate != nil { try container.encode(billedCrewRate, forKey: .billedCrewRate) }
        if projectCrewID != nil { try container.encode(projectCrewID, forKey: .projectCrewID) }
        if status != nil { try container.encode(status, forKey: .status) }
        if firstAddedDate != nil { try container.encode(firstAddedDate, forKey: .firstAddedDate) }
        if dateAddedToThisProject != nil { try container.encode(dateAddedToThisProject, forKey: .dateAddedToThisProject) }
    }
}

public class Contact : Codable
{
    public var contactId:Int
    public var contactType:Int
    public var firstName:String
    public var lastName:String
    public var name:String
    public var role:String
    public var title:String
    public var emailWork:String
    public var emailPersonal:String
    public var district:String
    public var districtID:Int
    public var school:String
    public var schoolID:Int
    public var state:String
    public var stateName:String
    public var stateID:Int
    public var countyID:Int
    public var county:String
    public var phone:String
    public var department:String
    public var flow:String
    public var lastContact:Date
    public var doNotContact:Bool
    public var active:Bool
    public var agentId:Int
    public var phoneAlt:String
    public var peraContactId:Int
    public var roomNumber:String
    public var sourceTypeId:Int
    public var sourceTypeDesc:String
    public var sourceNote:String
    public var contactStatusId:Int
    public var contactStatusDesc:String
    public var ssn:String
    public var dateOfBirth:Date
    public var deleted:Bool
    public var isShared:Bool
    public var address_line1:String
    public var address_city:String
    public var address_state:String
    public var address_zip:String
    public var deletedBy:String
    public var deletedDateTimeUtc:Date?
    public var hasNBC:Bool
    public var hasFactFinderSheet:Bool
    public var middleInitial:String
    public var tags:String
    public var dateCreated:Date
    public var phoneLabel:String
    public var altPhoneLabel:String
    public var carriers:String
    public var contactImage:String
    public var companyAffiliation:String
    public var additionalInformation:String
    public var hasGiftCard:Bool
    public var contactCategory:Int
    public var writingAgentId:Int
    public var writingAgentName:String
    public var maritalStatus:String
    public var totalDebtAmount:Double
    public var numberOfDebtAccounts:Int
    public var factFinderCodeId:Int
    public var businessName:String
    public var dba:String
    public var contactGUID:String
    public var projectEndDate:Date
    public var rate:Int
    public var jobID:Int
    public var jobName:String
    public var jobCount:Int
    public var locked:Bool
    public var lockedByAgentId:Int
    public var lockedTimestamp:Date
    public var initials:String
    public var contactCategoryName:String
    public var smsOptIn:Bool

    required public init(){}
}


Swift ProjectCrewRecruitsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/ProjectCrew/Recruits/{ProjectID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"ProjectID":0,"Tags":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"ProjectCrewMembers":[{"ProjectCrewContactID":0,"ProjectID":0,"CrewID":0,"CrewRate":0,"BilledCrewRate":0,"ProjectCrewID":0,"Status":"String","FirstAddedDate":"0001-01-01T00:00:00.0000000","DateAddedToThisProject":"0001-01-01T00:00:00.0000000","ContactId":0,"ContactType":0,"FirstName":"String","LastName":"String","Name":"String","Role":"String","Title":"String","EmailWork":"String","EmailPersonal":"String","District":"String","DistrictID":0,"School":"String","SchoolID":0,"State":"String","StateName":"String","StateID":0,"CountyID":0,"County":"String","Phone":"String","Department":"String","Flow":"String","LastContact":"0001-01-01T00:00:00.0000000","DoNotContact":false,"Active":false,"AgentId":0,"PhoneAlt":"String","PeraContactId":0,"RoomNumber":"String","SourceTypeId":0,"SourceTypeDesc":"String","SourceNote":"String","ContactStatusId":0,"ContactStatusDesc":"String","SSN":"String","DateOfBirth":"0001-01-01T00:00:00.0000000","Deleted":false,"IsShared":false,"address_line1":"String","address_city":"String","address_state":"String","address_zip":"String","DeletedBy":"String","DeletedDateTimeUtc":"0001-01-01T00:00:00.0000000","HasNBC":false,"HasFactFinderSheet":false,"MiddleInitial":"String","Tags":"String","DateCreated":"0001-01-01T00:00:00.0000000","PhoneLabel":"String","AltPhoneLabel":"String","Carriers":"String","ContactImage":"String","CompanyAffiliation":"String","AdditionalInformation":"String","HasGiftCard":false,"ContactCategory":0,"WritingAgentId":0,"WritingAgentName":"String","MaritalStatus":"String","TotalDebtAmount":0,"NumberOfDebtAccounts":0,"FactFinderCodeId":0,"BusinessName":"String","DBA":"String","ContactGUID":"00000000000000000000000000000000","ProjectEndDate":"0001-01-01T00:00:00.0000000","Rate":0,"JobID":0,"JobName":"String","JobCount":0,"Locked":false,"LockedByAgentId":0,"LockedTimestamp":"0001-01-01T00:00:00.0000000","Initials":"String","ContactCategoryName":"String","SMSOptIn":false}]}