"Unsupported protocol element" when creating Interactions programmatically

496 Views Asked by At

I am attempting to create new Interactions programmatically on Genesys Platform SDK 8.5 for Java.

I use the example on the API reference

public void createInteraction(String ixnType, String ixnSubtype, String queue) throws Exception
{
    RequestSubmit req = RequestSubmit.create();
    req.setInteractionType(ixnType);
    req.setInteractionSubtype(ixnSubtype);
    req.setQueue(queue);
    req.setMediaType("email");

    Message response = mPMService.getProtocol("IxnSrv").request(req);
    if(response == null || response.messageId() != EventAck.ID) {
          // For this sample, no error handling is implemented
          return;
    }

    EventAck event = (EventAck)response;
    mInteractionId = event.getExtension().getString("InteractionId");
}

However, this gives me an Unsupported protocol element error.

'EventError' (126) attributes:
    attr_error_desc [str] = "Unsupported protocol element"
    attr_ref_id [int] = 2
    attr_error_code [int] = 4

How do I create a new Interaction programmatically?

3

There are 3 best solutions below

0
On BEST ANSWER

Turns out I needed to set ClientType to InteractionClient.ReportingEngine.

0
On

First of all, you must open your protocol as Media Server. After that you must submit your interaction to interaction server.

Firstly your protocol config must be like this;

            interactionServerConfiguration.ClientName = "TestClient";
            interactionServerConfiguration.ClientType = InteractionClient.MediaServer;

            // Register this connection configuration with Protocol Manager
            protocolManagementService.Register(interactionServerConfiguration);

Note : You must have MediaServer type application definition on your Configuration Env., you must see it in CME. After open you connection to ixn server. You can submit your interaction what you like. Even you can create new type interaction just like i do. I did for our coopate sms system. Its name is not important. We defined it on our bussiness attribute, so our agent can send coopate 3rd party sms system from their agent desktop. Without new extension or new license :) Just tricked it system. Also genesys allows it. i know it because we are genesys official support team in our country :) (But agent seat license may be required depends on agent head count).

    RequestSubmit request = RequestSubmit.Create();
    request.TenantId = 1;
    request.MediaType = "email";
    request.Queue = c_inboundQueue;
    request.InteractionType = "Inbound";
    request.InteractionSubtype = "InboundNew";

    // Prepare the message to send. It is inserted in the request as UserData
    KeyValueCollection userData =
        new KeyValueCollection();

    // Prepare the message to send
    userData.Add("Subject", "subject goes here");
    request.UserData = userData;   protocolManagementService[c_interactionServerConfigurationIdentifier].Send(request);            
0
On

Interaction server should be connected with ClientType as either MediaServer or AgentApplication for this request(RequestSubmit).