{"openapi":"3.0.0","servers":[{"description":"API","url":"https://virtserver.swaggerhub.com/CatalystConsulting/311IntegrationRestAPIv2/1.0.0"}],"info":{"description":"City of Chicago 311 Application REST API","version":"1.04","title":"311 Application REST API","contact":{"email":"steven.jin@catconsult.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"tags":[{"name":"Work Order","description":"WorkOrder"}],"paths":{"/CreateWorkOrder/{source}":{"post":{"tags":["Work Order"],"parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string"}}],"summary":"Create a new Work Order in Salesforce","operationId":"createWorkOrder","responses":{"200":{"description":"Returns Work Order Id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"400":{"description":"Invalid Input"},"409":{"description":"An existing item already exists"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrder"}}},"description":"Type of service request to create"}}},"/CreateClosedWorkOrder":{"post":{"tags":["Work Order"],"parameters":[{"name":"source","in":"path","required":true,"schema":{"type":"string"}}],"summary":"Create and Close a Work Order in Salesforce","operationId":"createClosedWorkOrder","responses":{"200":{"description":"Returns Work Order Id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"400":{"description":"Invalid Input"},"409":{"description":"An existing item already exists"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrder"}}},"description":"Type of service request to create"}}},"/UpdateWorkOrder":{"post":{"tags":["Work Order"],"summary":"Update Work Order with EID","operationId":"updateWorkOrder","description":"For updates to Work Order and any related entities","responses":{"200":{"description":"Work Order Updated"},"400":{"description":"invalid input, fields are not right"},"409":{"description":"an existing item already exists"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrder"}}},"description":"Type of service request to create"}}},"/CloseWorkOrder":{"post":{"tags":["Work Order"],"summary":"Close Work Order","operationId":"closeWorkOrder","responses":{"200":{"description":"Work Order Closed"},"400":{"description":"invalid input, fields are not right"},"409":{"description":"an existing item already exists"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrder"}}},"description":"Type of Work Order to create"}}},"/CancelWorkOrder":{"post":{"tags":["Work Order"],"summary":"Cancel Work Order","operationId":"cancelWorkOrder","responses":{"200":{"description":"Work Order Canceled"},"400":{"description":"invalid input, fields are not right"},"409":{"description":"an existing item already exists"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkOrder"}}},"description":"Type of Work Order to create"}}},"/CreateWorkOrderImage":{"post":{"tags":["Images"],"summary":"Add a photo to the Work Order","operationId":"createImage","responses":{"200":{"description":"Image Created"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Image"}}}}}},"/CreateTreeWarranty":{"post":{"tags":["Warranty"],"summary":"Create Warranty record related to Work Order","operationId":"createAsset","responses":{"200":{"description":"Asset Created"}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TreeWarranty"}}}}}}},"components":{"schemas":{"WorkOrder":{"type":"object","required":["integrationId"],"properties":{"integrationId":{"type":"string","description":"Integration Id created in Salesforce"},"externalId":{"type":"string","description":"External Id of source system system"},"typeCode":{"type":"string","example":"WBX","description":"Type Code short code"},"groupCode":{"type":"string","description":"Team or group that owns this Work Order"},"priorityCode":{"type":"string","example":"Urgent","description":"Priority Code of Service Request"},"statusCode":{"type":"string","example":"Locked","description":"Status Code of Service Request"},"cancelReason":{"type":"string","example":"Not Need ed","description":"Reason for cancellation if Status is Canceled"},"workOrderNumber":{"type":"string","example":"19-01172292"},"parentWorkOrderIntegrationId":{"type":"string","description":"Eid of parent Work Order"},"parentServiceRequestNumber":{"type":"string","description":"Number of the parent Service Request(YY-#######) format"},"methodReceivedCode":{"type":"string","example":"Phone","description":"Method of received Service Request/Work Order"},"streetNumber":{"type":"number","example":11743,"description":"Number on street"},"streetDirection":{"type":"string","example":"S","description":"Direction of street"},"streetName":{"type":"string","example":"Hale","description":"Name of street"},"streetNameSuffix":{"type":"string","example":"AVE","description":"Street type"},"city":{"type":"string","example":"Chicago","description":"City"},"state":{"type":"string","example":"Illinois","description":"State"},"county":{"type":"string","example":"Cook","description":"County"},"zipCode":{"type":"string","description":"Five digit zip code"},"latitude":{"type":"string","description":"latitude value of address"},"longitude":{"type":"string","description":"longitude value of address"},"unitNumber":{"type":"string","example":"Apt 4","description":"Unit number in building"},"floor":{"type":"string","description":"Floor"},"buildingName":{"type":"string","description":"Building name"},"locationDetails":{"type":"string","description":"Miscellaneous details about location"},"details":{"type":"string","description":"Details or comments on Work Order"},"beginResolutionDate":{"type":"string","format":"date-time","description":"Time of start of resolution of Work Order"},"externalCreatedDate":{"type":"string","format":"date-time","description":"Created date in source system"},"externalCreatedBy":{"type":"string","description":"Eid of user who created Work Order"},"externalUpdatedDate":{"type":"string","format":"date-time","description":"Updated date in source system"},"externalUpdatedBy":{"type":"string","description":"Eid of user who last updated Work Order"},"createdDate":{"type":"string","format":"date-time","description":"Created date in source system"},"createdBy":{"type":"string","description":"Eid of user who created Work Order"},"updatedDate":{"type":"string","format":"date-time","description":"Updated date in source system"},"updatedBy":{"type":"string","description":"Eid of user who last updated Work Order"},"flexQuestions":{"type":"array","items":{"$ref":"#/components/schemas/FlexQuestion"},"description":"List of Flex Questions related to Work Order"},"participants":{"type":"array","items":{"$ref":"#/components/schemas/Participant"},"description":"List of Participants related to Work Order"},"activities":{"type":"array","items":{"$ref":"#/components/schemas/Activity"},"description":"List of Activities related to Work Order"},"geoAreas":{"type":"array","items":{"$ref":"#/components/schemas/GeoArea"},"description":"List of Geo Areas related to Work Order"}}},"CreateResponse":{"type":"object","properties":{"externalId":{"type":"string","description":"External id of the service request on insert"},"integrationid":{"type":"string","description":"Integration Id of the Work Order.  Used to update"},"workOrderNumber":{"type":"string","description":"Number of the Work Order. Autonumber prefixed with YY.  YY representing the year."},"status":{"type":"string","description":"Status of Work Order after call"},"serviceRequestNumber":{"type":"string","description":"Number of the Service Request. Autonumber prefixed with SRYY.  SR hardcoded, YY repesenting the year"}}},"FlexQuestion":{"type":"object","required":["flexQuestionCode"],"properties":{"externalId":{"type":"string","description":"External Id in source system"},"flexQuestionCode":{"type":"string","example":"fq001","description":"Common flex question code"},"flexQuestionText":{"type":"string","example":"Where is the location of the pothole?","description":"The text of the question"},"questionType":{"type":"string","example":"Intake vs Resolution","description":"Type of Flex Question"},"flexQuestionAnswer":{"type":"string","description":"Text value of answer of Flex Question"},"dataType":{"type":"string","example":"Freeform vs Date","description":"Format of answers of Flex Question"}}},"Participant":{"type":"object","properties":{"externalId":{"type":"string","description":"External Id in source system"},"isCaller":{"type":"string","example":"Y","description":"Indicates if current participant is the Caller"},"participantType":{"type":"string","example":"BUSINESS","description":"Type of participant"},"firstName":{"type":"string","description":"First Name of Participant"},"lastName":{"type":"string","description":"Last Name of Participant"},"email":{"type":"string","description":"Email of Participant"},"phoneNumber":{"type":"string","description":"Phone number of participant"},"mobilePhone":{"type":"string","description":"Mobile Phone number of participant"},"businessPhone":{"type":"string","description":"Business Phone number of participant"},"phoneNumberExtension":{"type":"string","description":"Phone number extension of participant"},"faxNumber":{"type":"string","description":"Fax number of participant"},"addressDescription":{"type":"string","description":"Address field to be used when street fields cannot be broken down"},"streetNumber":{"type":"string","description":"Street number of Participant"},"streetDirection":{"type":"string","description":"Street direction of Participant"},"streetName":{"type":"string","description":"Street name of address of Participant"},"streetType":{"type":"string","description":"Street type of address of Participant"},"city":{"type":"string","description":"City of address of Participant"},"state":{"type":"string","description":"State of address of Participant"},"zipCode":{"type":"string","description":"Zipcode of address of Participant"}}},"Activity":{"type":"object","required":["activityCode"],"properties":{"externalId":{"type":"string","description":"External Id in source system"},"activityCode":{"type":"string","description":"Unique Id of the Activity for the Work Order"},"status":{"type":"string","description":"Status of Activity"},"dueDate":{"type":"string","format":"date-time","description":"Date Time of due date"},"completeDate":{"type":"string","format":"date-time","description":"Date Time of date to be completed"},"assignedStaffId":{"type":"string","description":"User assigned to Activity"},"outcome":{"type":"string","description":"Outcome of the Activity, description of the outcome code"},"details":{"type":"string","description":"Comments and details of Activity"},"orderBy":{"type":"string","description":"Order number to display the Activity"},"questions":{"type":"array","items":{"$ref":"#/components/schemas/FlexQuestion"},"description":"List of Resolution Questions related to Activity"}}},"GeoArea":{"type":"object","properties":{"geoAreaCode":{"type":"string","description":"Layer Label"},"geoAreaValue":{"type":"string","description":"Layer"}}},"Image":{"type":"object","properties":{"workOrderId":{"type":"string","description":"Integration Id of Related Work Order"},"name":{"type":"string","description":"Image Name"},"extension":{"type":"string","description":"Image Extension","example":"jpg"},"body":{"type":"object","description":"binary of the Image in base 64 encoded string"}}},"TreeWarranty":{"type":"object"}}}}