1

How can I retrieve campaigns via the ExactTarget SOAP API using Java?

I want to retrieve all campaigns information via ExactTarget SOAP API with CXF using Java, but I don't know how. I tried this:

    RetrieveRequest request = new RetrieveRequest();
    request.setObjectType("Campaigns");

    String[] array = {"Status"};
    List<String> list = Arrays.asList(array);
    request.getProperties().addAll(list);
    RetrieveRequestMsg requestMsg = new RetrieveRequestMsg();
    requestMsg.setRetrieveRequest(request);
    RetrieveResponseMsg responseMsg = stub.retrieve(requestMsg);
    System.out.println("[overall status message] " + responseMsg.getOverallStatus());   

but what I got is:

[overall status message] Error: Unable to find a handler for object type: Campaigns. Object types are case-sensitive, check spelling.

Any idea of what I'm doing wrong?

  • What exactly are you having a problem with? Have you tried anything so far? – Alex Tennant Sep 16 '14 at 12:39
  • I want to retrieve all campaigns information via exacttarget soap api with CXF using java, but I don't know how. – Ward Miao Sep 17 '14 at 0:38
0

You can't retrieve Campaigns using the SOAP API. I also had the same question a while ago. The Campaigns object in the SOAP API isn't actually referring to a Campaign, rather it refers to "Programs".

However, you can easily retrieve campaigns using the REST API. Here's a sample GET request to retrieve all campaigns:

https://www.exacttargetapis.com/hub/v1/campaigns?access_token=insert-access-token-here

Refer to documented Campaign routes.

| improve this answer | |
  • Is there a way to update an existing Campaign in Marketing Cloud using REST API? I don't see it in the docs. – jagmohan Sep 2 '16 at 3:32
  • No, you can only create, read and delete campaigns at this time. – Eliot Harper Sep 2 '16 at 3:36
  • Thanks. I just wanted to make sure I'm not missing anything. – jagmohan Sep 2 '16 at 5:04
0

I am attempting to do something similar, and it doesn't look like this is supported by the API.

See the Campaign object doc.

It looks like the only methods that are supported by the campaign objects are Perform and Schedule.
So you can run a program right now, or schedule it to run in the future, but not inspect it.

This seems like a pretty poor implementation for this object - it would nice to at least be able to inspect, via the API, the various steps a program/campaign will perform.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.