swagger: '2.0' info: title: Automile ClientApi ResourceOwnerContact2 API version: v1 tags: - name: ResourceOwnerContact2 paths: /v1/resourceowner/contacts2: get: tags: - ResourceOwnerContact2 summary: Get a list of all contacts that user is associated with description: Only companies that the user is associated with will be returned by this operation. operationId: GetResourceOwnerContacts2 produces: - text/plain - application/json - text/json responses: '200': description: The contacts are returned schema: type: array items: $ref: '#/definitions/Contact2Model' '500': description: Internal server error security: - oauth2: [] post: tags: - ResourceOwnerContact2 summary: Creates a new contact operationId: CreateResourceOwnerContact2 consumes: - application/json - text/json - application/*+json produces: - text/plain - application/json - text/json parameters: - in: body name: body description: The contact model schema: $ref: '#/definitions/Contact2CreateModel' responses: '200': description: A link in the header is returned to the newly created contact '403': description: Request is forbidden, this could occur if you try to associate the contact you are not associated with schema: $ref: '#/definitions/ProblemDetails' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/contacts2/{contactId}: get: tags: - ResourceOwnerContact2 summary: Get a contact by id description: The user only has access to companies that it is associated with operationId: GetResourceOwnerContact2 produces: - text/plain - application/json - text/json parameters: - in: path name: contactId description: The contact id required: true type: integer format: int32 responses: '200': description: The contact is returned schema: $ref: '#/definitions/Contact2DetailModel' '403': description: Request is forbidden, meaning you dont' have access to this contact schema: $ref: '#/definitions/ProblemDetails' '404': description: Contact does not exist schema: $ref: '#/definitions/ProblemDetails' '500': description: Internal server error security: - oauth2: [] put: tags: - ResourceOwnerContact2 summary: Updates the given contact id description: This will update the contact with the new model. operationId: EditResourceOwnerContact2 consumes: - application/json - text/json - application/*+json produces: - text/plain - application/json - text/json parameters: - in: path name: contactId description: The contact that should be updated required: true type: integer format: int32 - in: body name: body description: The new contact model schema: $ref: '#/definitions/Contact2EditModel' responses: '200': description: The contact was saved '404': description: The contact that you tried to update doesn't exist schema: $ref: '#/definitions/ProblemDetails' '403': description: Request is forbidden, this could occur if you are not associated with the contact schema: $ref: '#/definitions/ProblemDetails' '500': description: Internal server error security: - oauth2: [] delete: tags: - ResourceOwnerContact2 summary: Removes the given contact operationId: DeleteResourceOwnerContact2 produces: - text/plain - application/json - text/json parameters: - in: path name: contactId description: The company id required: true type: integer format: int32 responses: '200': description: The contact has been deleted '403': description: Forbidden schema: $ref: '#/definitions/ProblemDetails' '404': description: The contact that you tried to remove doesn't exist schema: $ref: '#/definitions/ProblemDetails' '500': description: Internal server error '400': description: Request is bad, You can't delete a contact that is bound to a user security: - oauth2: [] /v1/resourceowner/contacts2/me: get: tags: - ResourceOwnerContact2 summary: Get the contact representing myself operationId: GetResourceOwnerContactMe2 produces: - text/plain - application/json - text/json responses: '200': description: The contact is returned schema: $ref: '#/definitions/Contact2DetailModel' '403': description: Request is forbidden, meaning you dont' have access to this contact schema: $ref: '#/definitions/ProblemDetails' '404': description: Contact does not exist schema: $ref: '#/definitions/ProblemDetails' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/contacts2/me/image: get: tags: - ResourceOwnerContact2 summary: Get contact profile image description: This will get the contact profile image, image data is returned in the response content operationId: GetImage parameters: - in: query name: imageType description: enum ApiImageType type: integer format: int32 enum: - 0 - 1 responses: '200': description: Success security: - oauth2: [] /v1/resourceowner/contacts2/me/uploadimage: post: tags: - ResourceOwnerContact2 summary: Upload contact profile image description: This updates the contact profile image operationId: MeUploadImage consumes: - multipart/form-data parameters: - in: formData name: ContentType type: string - in: formData name: ContentDisposition type: string - in: formData name: Headers type: string - in: formData name: Length type: integer format: int64 - in: formData name: Name type: string - in: formData name: FileName type: string responses: '200': description: Profile image was saved '500': description: Internal server error '406': description: Request is not properly formatted security: - oauth2: [] /v1/resourceowner/contacts2/me/removeimage: put: tags: - ResourceOwnerContact2 summary: Removes the users profile image" description: This removes the contact profile image operationId: MeRemoveImage responses: '200': description: The profile image has been deleted '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/contacts2/update-rfid: post: tags: - ResourceOwnerContact2 operationId: UpdateRfidResourceOwnerContact2 consumes: - application/json - text/json - application/*+json parameters: - in: body name: body schema: $ref: '#/definitions/Contact2UpdateRfidModel' responses: '200': description: Success security: - oauth2: [] /v1/resourceowner/contacts2/me/updatedefaultvehicle/{vehicleId}: put: tags: - ResourceOwnerContact2 summary: Updates the default vehicle description: This will update the default vehicle operationId: MeUpdateDefaultVehicle2 produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 responses: '200': description: The default vehicle on contact was saved '403': description: Request is forbidden, this could occur if you are not associated with the contact schema: $ref: '#/definitions/ProblemDetails' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/contacts2/updatedefaultvehicle/{vehicleId}: put: tags: - ResourceOwnerContact2 summary: Updates the default vehicle description: This will update the default vehicle operationId: UpdateResourceOwnerContactDefaultVehicle2 produces: - text/plain - application/json - text/json parameters: - in: path name: vehicleId description: The vehicle id required: true type: integer format: int32 responses: '200': description: The default vehicle on contact was saved '403': description: Request is forbidden, this could occur if you are not associated with the contact schema: $ref: '#/definitions/ProblemDetails' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/contacts2/customcategory: post: tags: - ResourceOwnerContact2 summary: Add and remove custom categories operationId: ResourceOwnerContact2CustomCategory consumes: - application/json - text/json - application/*+json parameters: - in: body name: body description: The contact model schema: $ref: '#/definitions/CustomCategoryPostModel' responses: '200': description: '' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/contacts2/{contactId}/customcategories/{customCategoryId}: get: tags: - ResourceOwnerContact2 summary: Get a custom category description: '' operationId: GetCustomCategoryResourceOwnerContacts2 produces: - text/plain - application/json - text/json parameters: - in: path name: contactId required: true type: integer format: int32 - in: path name: customCategoryId required: true type: integer format: int32 responses: '200': description: '' schema: $ref: '#/definitions/CustomCategoryModel' '500': description: Internal server error security: - oauth2: [] /v1/resourceowner/contacts2/{contactId}/customcategories: get: tags: - ResourceOwnerContact2 summary: Get a all custom categories description: '' operationId: GetCustomCategoriesResourceOwnerContacts2 produces: - text/plain - application/json - text/json parameters: - in: path name: contactId required: true type: integer format: int32 responses: '200': description: '' schema: $ref: '#/definitions/CustomCategoryModel' '500': description: Internal server error security: - oauth2: [] definitions: Contact2UpdateRfidModel: type: object properties: Email: type: string Rfid: type: string additionalProperties: false CustomCategoryPostModel: type: object properties: ContactId: format: int32 type: integer Added: description: Custom categories to add type: array items: $ref: '#/definitions/CustomCategoryCreateModel' Removed: description: Custom categories to delete type: array items: format: int32 type: integer additionalProperties: false CompanyScopesModel: type: object properties: CompanyId: format: int32 type: integer VehicleIds: type: array items: format: int32 type: integer Scopes: type: array items: type: string additionalProperties: false Contact2Model: type: object properties: ContactId: format: int32 type: integer FirstName: type: string LastName: type: string EmailAddress: type: string MobilePhoneNumber: type: string ProfileImageUrl: type: string CheckedInDateTimeUtc: format: date-time type: string CheckedIntoVehicleId: format: int32 type: integer CheckedInVehicleOdometerInKilometers: format: double type: number IsManager: type: boolean LastCheckedInTripType: format: int32 enum: - 0 - 1 - 2 - 3 type: integer CheckedInCustomTripTypeName: type: string CompanyRoles: type: array items: format: int32 enum: - 0 - 1 - 2 - 3 - 4 - 5 type: integer CurrencyCode: description: ISO 4217 Currency code type: string additionalProperties: false TimeSpan: type: object properties: Ticks: format: int64 type: integer Days: format: int32 type: integer readOnly: true Hours: format: int32 type: integer readOnly: true Milliseconds: format: int32 type: integer readOnly: true Microseconds: format: int32 type: integer readOnly: true Nanoseconds: format: int32 type: integer readOnly: true Minutes: format: int32 type: integer readOnly: true Seconds: format: int32 type: integer readOnly: true TotalDays: format: double type: number readOnly: true TotalHours: format: double type: number readOnly: true TotalMilliseconds: format: double type: number readOnly: true TotalMicroseconds: format: double type: number readOnly: true TotalNanoseconds: format: double type: number readOnly: true TotalMinutes: format: double type: number readOnly: true TotalSeconds: format: double type: number readOnly: true additionalProperties: false HoursOfServiceSettingsModel: type: object properties: TimeZoneType: format: int32 enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 type: integer WorkDayStartTime: $ref: '#/definitions/TimeSpan' CycleRuleType: format: int32 enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 type: integer CargoTypeType: format: int32 enum: - 0 - 1 - 2 type: integer RestartRuleType: format: int32 enum: - 0 - 1 type: integer RestBreakRuleType: format: int32 enum: - 0 - 1 type: integer ShortHaulExceptionType: format: int32 enum: - 0 - 1 type: integer OdometerUnitType: format: int32 enum: - 0 - 1 - 2 type: integer WellSiteRuleType: format: int32 enum: - 0 - 1 type: integer CarrierInfo: $ref: '#/definitions/AddressModel' IsEnabled: type: boolean additionalProperties: false OrganizationModel: type: object properties: OrganizationName: type: string LegalIdentificationNumber: type: string VATNumber: type: string BillingAddress: $ref: '#/definitions/AddressModel' ShipmentAddress: $ref: '#/definitions/AddressModel' Culture: type: string UnitType: format: int32 enum: - 0 - 1 - 2 type: integer IsHierarchyEnabled: type: boolean ISO4217CurrencyCode: type: string OrganizationId: format: int32 type: integer additionalProperties: false Contact2DetailModel: type: object properties: ContactId: format: int32 type: integer FirstName: type: string LastName: type: string EmailAddress: type: string Description: type: string CultureName: type: string CountryCodeIso1366: type: string DefaultVehicleId: format: int32 type: integer UnitType: format: int32 enum: - 0 - 1 - 2 type: integer SubscribeToNewsLetter: type: boolean MobilePhoneNumber: type: string MapType: format: int32 enum: - 0 - 1 - 2 type: integer CheckedIntoVehicleId: format: int32 type: integer CheckedInDateTimeUtc: format: date-time type: string CheckOutDateTimeUtc: format: date-time type: string CheckedInTripType: format: int32 enum: - 0 - 1 - 2 - 3 type: integer CheckedInCustomTripTypeName: type: string CompanyRoles: type: array items: format: int32 enum: - 0 - 1 - 2 - 3 - 4 - 5 type: integer ProfileImageUrl: type: string CurrencyCode: description: ISO 4217 Currency code type: string CompaniesScopes: type: array items: $ref: '#/definitions/CompanyScopesModel' IsLocked: type: boolean CustomCategories: type: array items: $ref: '#/definitions/CustomCategoryModel' CheckedInVehicleOdometerInKilometers: format: double type: number Organization: $ref: '#/definitions/OrganizationModel' HoursOfServiceSettingsModel: $ref: '#/definitions/HoursOfServiceSettingsModel' FieldServiceEnabled: type: boolean FieldServiceEnabledWithinOrganization: type: boolean ContactMenuLayout: $ref: '#/definitions/ContactMenuLayoutModel' CreatedAt: format: date-time type: string additionalProperties: false AddressModel: required: - AddressLine2 - City - ISO3166CountryCode - ZipCode type: object properties: AddressId: format: int32 type: integer CompanyName: type: string ContactNameAtAddress: type: string AddressLine2: minLength: 1 type: string AddressLine3: type: string AddressLine4: type: string ZipCode: minLength: 1 type: string City: minLength: 1 type: string StateOrProvince: type: string ISO3166CountryCode: minLength: 1 type: string additionalProperties: false Contact2EditModel: type: object properties: FirstName: type: string LastName: type: string EmailAddress: type: string Description: type: string CultureName: type: string CountryCodeIso1366: type: string DefaultVehicleId: format: int32 type: integer UnitType: format: int32 enum: - 0 - 1 - 2 type: integer SubscribeToNewsLetter: type: boolean MobilePhoneNumber: type: string MapType: format: int32 enum: - 0 - 1 - 2 type: integer CheckOutDateTimeUtc: format: date-time type: string CheckedInTripType: format: int32 enum: - 0 - 1 - 2 - 3 type: integer CheckedInCustomTripTypeName: type: string CurrencyCode: description: ISO 4217 Currency code type: string additionalProperties: false ContactMenuLayoutModel: type: object properties: MenuLayout: type: object additionalProperties: format: int64 enum: - 0 - 1 - 2 - 4 type: integer readOnly: true ExpiresAtUtc: format: date-time description: UTC date time when menu layout cache was refreshed type: string RefreshedAtUtc: format: date-time description: UTC date time when menu layout cache was refreshed type: string additionalProperties: false ProblemDetails: type: object properties: type: type: string title: type: string status: format: int32 type: integer detail: type: string instance: type: string additionalProperties: {} Contact2CreateModel: required: - CreateRelationshipToCompanyId - FirstName - LastName type: object properties: FirstName: minLength: 1 type: string LastName: minLength: 1 type: string EmailAddress: type: string Description: type: string CreateRelationshipToCompanyId: format: int32 type: integer CultureName: type: string CountryCodeIso1366: type: string DefaultVehicleId: format: int32 type: integer UnitType: format: int32 enum: - 0 - 1 - 2 type: integer SubscribeToNewsLetter: type: boolean MobilePhoneNumber: type: string MapType: format: int32 enum: - 0 - 1 - 2 type: integer CurrencyCode: description: ISO 4217 Currency code type: string additionalProperties: false CustomCategoryCreateModel: type: object properties: Value: type: string CustomCategoryType: format: int32 enum: - 0 - 1 type: integer additionalProperties: false CustomCategoryModel: type: object properties: CustomCategoryId: format: int32 type: integer Value: type: string CustomCategoryType: format: int32 enum: - 0 - 1 type: integer additionalProperties: false securityDefinitions: oauth2: type: oauth2 flow: implicit authorizationUrl: https://api.automile.com/login/ scopes: read: Read access to protected resources write: Write access to protected resources description: OAuth2 Implicit Grant