(crm().activities())
List activities
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.ActivitiesFilter;
import com.apideck.unify.models.components.ActivitiesSort;
import com.apideck.unify.models.components.ActivitiesSortBy;
import com.apideck.unify.models.components.SortDirection;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.CrmActivitiesAllRequest;
import com.apideck.unify.models.operations.CrmActivitiesAllResponse;
import java.lang.Exception;
import java.time.OffsetDateTime;
import java.util.Map;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
CrmActivitiesAllRequest req = CrmActivitiesAllRequest.builder()
.serviceId("salesforce")
.filter(ActivitiesFilter.builder()
.companyId("1234")
.ownerId("1234")
.contactId("1234")
.updatedSince(OffsetDateTime.parse("2020-09-30T07:43:32.000Z"))
.type("Task")
.build())
.sort(ActivitiesSort.builder()
.by(ActivitiesSortBy.CREATED_AT)
.direction(SortDirection.DESC)
.build())
.passThrough(Map.ofEntries(
Map.entry("search", "San Francisco")))
.fields("id,updated_at")
.build();
CrmActivitiesAllResponse res = sdk.crm().activities().list()
.request(req)
.call();
if (res.getActivitiesResponse().isPresent()) {
// handle response
}
}
}
CrmActivitiesAllResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Create activity
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.ActivityAttendeeInput;
import com.apideck.unify.models.components.ActivityAttendeeStatus;
import com.apideck.unify.models.components.ActivityInput;
import com.apideck.unify.models.components.ActivityType;
import com.apideck.unify.models.components.Address;
import com.apideck.unify.models.components.CustomField;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.ShowAs;
import com.apideck.unify.models.components.Type;
import com.apideck.unify.models.components.Value;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.CrmActivitiesAddRequest;
import com.apideck.unify.models.operations.CrmActivitiesAddResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
CrmActivitiesAddRequest req = CrmActivitiesAddRequest.builder()
.activity(ActivityInput.builder()
.type(ActivityType.MEETING)
.activityDatetime("2021-05-01T12:00:00.000Z")
.durationSeconds(1800L)
.userId("12345")
.accountId("12345")
.contactId("12345")
.companyId("12345")
.opportunityId("12345")
.leadId("12345")
.ownerId("12345")
.campaignId("12345")
.caseId("12345")
.assetId("12345")
.contractId("12345")
.productId("12345")
.solutionId("12345")
.customObjectId("12345")
.title("Meeting")
.description("More info about the meeting")
.note("An internal note about the meeting")
.location("Space")
.locationAddress(Address.builder()
.id("123")
.type(Type.PRIMARY)
.string("25 Spring Street, Blackburn, VIC 3130")
.name("HQ US")
.line1("Main street")
.line2("apt #")
.line3("Suite #")
.line4("delivery instructions")
.streetNumber("25")
.city("San Francisco")
.state("CA")
.postalCode("94104")
.country("US")
.latitude("40.759211")
.longitude("-73.984638")
.county("Santa Clara")
.contactName("Elon Musk")
.salutation("Mr")
.phoneNumber("111-111-1111")
.fax("122-111-1111")
.email("[email protected]")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build())
.allDayEvent(false)
.private_(true)
.groupEvent(true)
.eventSubType("debrief")
.groupEventType("Proposed")
.child(false)
.archived(false)
.deleted(false)
.showAs(ShowAs.BUSY)
.done(false)
.startDatetime("2021-05-01T12:00:00.000Z")
.endDatetime("2021-05-01T12:30:00.000Z")
.activityDate("2021-05-01")
.endDate("2021-05-01")
.recurrent(false)
.reminderDatetime("2021-05-01T17:00:00.000Z")
.reminderSet(false)
.videoConferenceUrl("https://us02web.zoom.us/j/88120759396")
.videoConferenceId("zoom:88120759396")
.customFields(List.of(
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.value(Value.of(true))
.build()))
.attendees(List.of(
ActivityAttendeeInput.builder()
.name("Elon Musk")
.firstName("Elon")
.middleName("D.")
.lastName("Musk")
.prefix("Mr.")
.suffix("PhD")
.emailAddress("[email protected]")
.isOrganizer(true)
.status(ActivityAttendeeStatus.ACCEPTED)
.build()))
.passThrough(List.of(
PassThroughBody.builder()
.serviceId("<id>")
.extendPaths(List.of(
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build()))
.build()))
.build())
.serviceId("salesforce")
.build();
CrmActivitiesAddResponse res = sdk.crm().activities().create()
.request(req)
.call();
if (res.createActivityResponse().isPresent()) {
// handle response
}
}
}
CrmActivitiesAddResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Get activity
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.CrmActivitiesOneRequest;
import com.apideck.unify.models.operations.CrmActivitiesOneResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
CrmActivitiesOneRequest req = CrmActivitiesOneRequest.builder()
.id("<id>")
.serviceId("salesforce")
.fields("id,updated_at")
.build();
CrmActivitiesOneResponse res = sdk.crm().activities().get()
.request(req)
.call();
if (res.getActivityResponse().isPresent()) {
// handle response
}
}
}
CrmActivitiesOneResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Update activity
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.components.ActivityAttendeeInput;
import com.apideck.unify.models.components.ActivityAttendeeStatus;
import com.apideck.unify.models.components.ActivityInput;
import com.apideck.unify.models.components.ActivityType;
import com.apideck.unify.models.components.Address;
import com.apideck.unify.models.components.CustomField;
import com.apideck.unify.models.components.ExtendPaths;
import com.apideck.unify.models.components.PassThroughBody;
import com.apideck.unify.models.components.ShowAs;
import com.apideck.unify.models.components.Type;
import com.apideck.unify.models.components.Value;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.CrmActivitiesUpdateRequest;
import com.apideck.unify.models.operations.CrmActivitiesUpdateResponse;
import java.lang.Exception;
import java.util.List;
import java.util.Map;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
CrmActivitiesUpdateRequest req = CrmActivitiesUpdateRequest.builder()
.id("<id>")
.activity(ActivityInput.builder()
.type(ActivityType.MEETING)
.activityDatetime("2021-05-01T12:00:00.000Z")
.durationSeconds(1800L)
.userId("12345")
.accountId("12345")
.contactId("12345")
.companyId("12345")
.opportunityId("12345")
.leadId("12345")
.ownerId("12345")
.campaignId("12345")
.caseId("12345")
.assetId("12345")
.contractId("12345")
.productId("12345")
.solutionId("12345")
.customObjectId("12345")
.title("Meeting")
.description("More info about the meeting")
.note("An internal note about the meeting")
.location("Space")
.locationAddress(Address.builder()
.id("123")
.type(Type.PRIMARY)
.string("25 Spring Street, Blackburn, VIC 3130")
.name("HQ US")
.line1("Main street")
.line2("apt #")
.line3("Suite #")
.line4("delivery instructions")
.streetNumber("25")
.city("San Francisco")
.state("CA")
.postalCode("94104")
.country("US")
.latitude("40.759211")
.longitude("-73.984638")
.county("Santa Clara")
.contactName("Elon Musk")
.salutation("Mr")
.phoneNumber("111-111-1111")
.fax("122-111-1111")
.email("[email protected]")
.website("https://elonmusk.com")
.notes("Address notes or delivery instructions.")
.rowVersion("1-12345")
.build())
.allDayEvent(false)
.private_(true)
.groupEvent(true)
.eventSubType("debrief")
.groupEventType("Proposed")
.child(false)
.archived(false)
.deleted(false)
.showAs(ShowAs.BUSY)
.done(false)
.startDatetime("2021-05-01T12:00:00.000Z")
.endDatetime("2021-05-01T12:30:00.000Z")
.activityDate("2021-05-01")
.endDate("2021-05-01")
.recurrent(false)
.reminderDatetime("2021-05-01T17:00:00.000Z")
.reminderSet(false)
.videoConferenceUrl("https://us02web.zoom.us/j/88120759396")
.videoConferenceId("zoom:88120759396")
.customFields(List.of(
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.build(),
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.value(Value.of(true))
.build(),
CustomField.builder()
.id("2389328923893298")
.name("employee_level")
.description("Employee Level")
.value(Value.of(true))
.build()))
.attendees(List.of(
ActivityAttendeeInput.builder()
.name("Elon Musk")
.firstName("Elon")
.middleName("D.")
.lastName("Musk")
.prefix("Mr.")
.suffix("PhD")
.emailAddress("[email protected]")
.isOrganizer(true)
.status(ActivityAttendeeStatus.ACCEPTED)
.build()))
.passThrough(List.of(
PassThroughBody.builder()
.serviceId("<id>")
.extendPaths(List.of(
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build()))
.build(),
PassThroughBody.builder()
.serviceId("<id>")
.extendPaths(List.of(
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build(),
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build(),
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build()))
.build(),
PassThroughBody.builder()
.serviceId("<id>")
.extendPaths(List.of(
ExtendPaths.builder()
.path("$.nested.property")
.value(Map.ofEntries(\n Map.entry("TaxClassificationRef", Map.ofEntries(\n Map.entry("value", "EUC-99990201-V1-00020000")))))
.build()))
.build()))
.build())
.serviceId("salesforce")
.build();
CrmActivitiesUpdateResponse res = sdk.crm().activities().update()
.request(req)
.call();
if (res.updateActivityResponse().isPresent()) {
// handle response
}
}
}
CrmActivitiesUpdateResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |
Delete activity
package hello.world;
import com.apideck.unify.Apideck;
import com.apideck.unify.models.errors.BadRequestResponse;
import com.apideck.unify.models.errors.NotFoundResponse;
import com.apideck.unify.models.errors.PaymentRequiredResponse;
import com.apideck.unify.models.errors.UnauthorizedResponse;
import com.apideck.unify.models.errors.UnprocessableResponse;
import com.apideck.unify.models.operations.CrmActivitiesDeleteRequest;
import com.apideck.unify.models.operations.CrmActivitiesDeleteResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception {
Apideck sdk = Apideck.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.consumerId("test-consumer")
.appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX")
.build();
CrmActivitiesDeleteRequest req = CrmActivitiesDeleteRequest.builder()
.id("<id>")
.serviceId("salesforce")
.build();
CrmActivitiesDeleteResponse res = sdk.crm().activities().delete()
.request(req)
.call();
if (res.deleteActivityResponse().isPresent()) {
// handle response
}
}
}
CrmActivitiesDeleteResponse
Error Type |
Status Code |
Content Type |
models/errors/BadRequestResponse |
400 |
application/json |
models/errors/UnauthorizedResponse |
401 |
application/json |
models/errors/PaymentRequiredResponse |
402 |
application/json |
models/errors/NotFoundResponse |
404 |
application/json |
models/errors/UnprocessableResponse |
422 |
application/json |
models/errors/APIException |
4XX, 5XX |
*/* |