CreateActivityForUserWithNumbers Input
Description: Input type used for the CreateActivityForUserWithNumbers mutation. This type defines all the parameters required to create a new activity record.
Type Structure
Type Name: CreateActivityForUserWithNumbers
Fields (all required):
UserEmail:String!- Email address of the user performing the activityApplicableDate:String!- Date when the activity occurredMatterNumber:String!- Reference number of the matterMatterPhaseNumber:String!- Reference number of the matter phaseActivityTypeNumber:String!- Reference number of the activity typeUnitNumber:String!- Reference number of the unit (department/business unit)Description:String!- Detailed description of the activity performedBillableQuantity:Float!- Number of billable hours spentNonBillableQuantity:Float!- Number of non-billable hours spent
Example Usage
This input type is used exclusively with the CreateActivityForUserWithNumbers mutation:
cURL
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"query": "mutation CreateActivity($input: CreateActivityForUserWithNumbers!) { CreateActivityForUserWithNumbers(createActivityForUserWithNumbers: $input) { Id } }",
"variables": {
"input": {
"UserEmail": "john.doe@company.com",
"ApplicableDate": "2023-11-15",
"MatterNumber": "MAT-2023-001",
"MatterPhaseNumber": "PH-2023-001-A",
"ActivityTypeNumber": "ACT-001",
"UnitNumber": "UNIT-001",
"Description": "Conducted legal research on corporate restructuring regulations",
"BillableQuantity": 3.5,
"NonBillableQuantity": 1.0
}
}
}' \
https://sandbox.drivepractice.com/api/v1/graphqlField Details
UserEmail
- Type:
String!(Non-null String) - Description: Email address of the user who performed the activity
- Example:
"john.doe@company.com" - Format: Valid email format (user@domain.com)
- Usage: Identifies which user is responsible for the time entry
ApplicableDate
- Type:
String!(Non-null String) - Description: Date when the activity occurred
- Example:
"2023-11-15" - Format: ISO 8601 date format (YYYY-MM-DD)
- Usage: Tracks when the work was performed for reporting and billing
MatterNumber
- Type:
String!(Non-null String) - Description: Reference number of the matter being worked on
- Example:
"MAT-2023-001" - Format: Typically follows pattern
MAT-YYYY-NNN - Usage: Associates the activity with a specific matter/project
MatterPhaseNumber
- Type:
String!(Non-null String) - Description: Reference number of the matter phase
- Example:
"PH-2023-001-A" - Format: Typically follows pattern
PH-YYYY-NNN-X - Usage: Associates the activity with a specific phase of a matter
ActivityTypeNumber
- Type:
String!(Non-null String) - Description: Reference number of the activity type
- Example:
"ACT-001" - Format: Typically follows pattern
ACT-NNN - Usage: Categorizes the type of work performed
UnitNumber
- Type:
String!(Non-null String) - Description: Reference number of the unit/department
- Example:
"UNIT-001" - Format: Typically follows pattern
UNIT-NNN - Usage: Associates the activity with a specific business unit or department
Description
- Type:
String!(Non-null String) - Description: Detailed description of the activity performed
- Example:
"Conducted legal research on corporate restructuring regulations and prepared summary document" - Usage: Provides context about what work was done
BillableQuantity
- Type:
Float!(Non-null Float) - Description: Number of billable hours spent
- Example:
3.5 - Format: Decimal number representing hours (e.g., 2.5 for 2 hours 30 minutes)
- Usage: Tracks time that can be billed to the client
NonBillableQuantity
- Type:
Float!(Non-null Float) - Description: Number of non-billable hours spent
- Example:
1.0 - Format: Decimal number representing hours
- Usage: Tracks time that cannot be billed to the client (e.g., administrative tasks)
Complete Example
{
"UserEmail": "jane.smith@company.com",
"ApplicableDate": "2023-11-16",
"MatterNumber": "MAT-2023-002",
"MatterPhaseNumber": "PH-2023-002-A",
"ActivityTypeNumber": "ACT-002",
"UnitNumber": "UNIT-002",
"Description": "Client meeting to discuss compliance requirements and review project timeline. Prepared agenda and follow-up action items.",
"BillableQuantity": 2.0,
"NonBillableQuantity": 0.5
}Validation Rules
- All Fields Required: Every field in this input type is required (marked with
!) - Email Format:
UserEmailmust be a valid email address - Date Format:
ApplicableDatemust be a valid date in YYYY-MM-DD format - Positive Numbers:
BillableQuantityandNonBillableQuantitymust be non-negative numbers - Number Formats: Reference numbers must follow their respective patterns
Best Practices
- Complete Information: Provide all required fields with accurate information
- Detailed Descriptions: Write detailed descriptions that explain what was accomplished
- Accurate Time Tracking: Record actual time spent, not estimated time
- Proper Categorization: Use the correct matter, phase, activity type, and unit numbers
- Date Accuracy: Use the correct date for when the work was performed
- Regular Entry: Record time entries regularly throughout the day
Common Activity Type Examples
| Activity Type | Description | Example Use Case |
|---|---|---|
| ACT-001 | Legal Research | Researching case law and regulations |
| ACT-002 | Client Meeting | Meetings with clients to discuss matters |
| ACT-003 | Document Preparation | Creating legal documents and contracts |
| ACT-004 | Court Appearance | Time spent in court proceedings |
| ACT-005 | Administrative Tasks | Internal administrative work |
| ACT-006 | Travel Time | Time spent traveling for business |
| ACT-007 | Training/Development | Professional development activities |
Unit Examples
| Unit Number | Description |
|---|---|
| UNIT-001 | Corporate Law Department |
| UNIT-002 | Compliance Department |
| UNIT-003 | Litigation Department |
| UNIT-004 | Intellectual Property Department |
| UNIT-005 | Tax Law Department |
Error Handling
Common validation errors:
Missing Required Field
{
"errors": [
{
"message": "Field 'UserEmail' of required type 'String!' was not provided.",
"locations": [
{
"line": 2,
"column": 3
}
],
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED"
}
}
]
}Invalid Email Format
{
"errors": [
{
"message": "UserEmail must be a valid email address",
"extensions": {
"code": "BAD_USER_INPUT"
}
}
]
}Invalid Date Format
{
"errors": [
{
"message": "ApplicableDate must be a valid date in YYYY-MM-DD format",
"extensions": {
"code": "BAD_USER_INPUT"
}
}
]
}Negative Time Quantity
{
"errors": [
{
"message": "BillableQuantity must be a non-negative number",
"extensions": {
"code": "BAD_USER_INPUT"
}
}
]
}Integration with GraphQL Variables
When using GraphQL clients, it’s recommended to use variables for the input:
const mutation = `
mutation CreateActivity($input: CreateActivityForUserWithNumbers!) {
CreateActivityForUserWithNumbers(createActivityForUserWithNumbers: $input) {
Id
}
}
`;
const variables = {
input: {
UserEmail: "john.doe@company.com",
ApplicableDate: "2023-11-15",
MatterNumber: "MAT-2023-001",
MatterPhaseNumber: "PH-2023-001-A",
ActivityTypeNumber: "ACT-001",
UnitNumber: "UNIT-001",
Description: "Conducted legal research",
BillableQuantity: 3.5,
NonBillableQuantity: 1.0
}
};
const data = await request(
'https://sandbox.drivepractice.com/api/v1/graphql',
mutation,
variables,
{
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
);This approach makes your queries more maintainable and easier to debug.