Skip Navigation
Expand
Setting privileged access for knowledge foundation API
Answer ID 5559   |   Last Review Date 04/14/2019

How do I set privileged access or an SLA to my knowledge foundation API?

Environment


CX version February 2012 with Email, Knowledge base, Knowledge Foundation API


Resolution

To set privileged answer access in Knowledge Foundation API, the minimum amount of information you have to pass in is one of the following:

  • Contact ID
  • Contact name (Full name AKA first name + “ “ + last name)
  • Org ID
  • Org Name

Note: You do not have to pass all of them, just one out of the list.

If the SLA is tied directly to the contact record, you need to pass in enough information to identify the contact. That can be ID OR Name (full name) OR both.

If the SLA is tied directly to the organization record, you need to passin enough to identify the contact (like above) OR the Org. To uniquely identify the Org, you can use ID OR Name OR both.

You can pass in all the data if you want (just ID, ID + Name, Org + Contact, etc).

  • If you pass in contact identifiers and organization identifiers, the contact must belong to the organization you identify; otherwise, and error will be thrown.

If a contact does NOT have and Org., it has to have an SLA instance to get access to answers with an access level that the SLA gives them access to. If the contact does have an Org., any contact level SLA instances are ignored and the organization level SLAs are used.

Examples of C# .NET code:

Calling SearchContent for a contact (by ID) who has an SLA for priviledged answer access:

RightNowKnowledgePortClient client = new RightNowKnowledgePortClient();
client.ClientCredentials.UserName.UserName = "user";
client.ClientCredentials.UserName.Password = "AReallyComplicatedPassword";


ClientInfoHeader header = new ClientInfoHeader();
header.AppID = "42";


string interactionID = client.StartInteraction(header, "KFAPITester", "192.168.1.1", null, "KF API Client");


ContentSecurityOptions security = new ContentSecurityOptions();
security.Contact = new NamedID();
security.Contact.ID = new ID();
security.Contact.ID.id = 1;
security.Contact.ID.idSpecified = true;


SearchResponse searchResponse = client.SearchContent(header, interactionID, "test", null, false, false, 10, null, security, null, 0);


if (searchResponse.SummaryContents != null)
      foreach (SummaryContent summaryContent in searchResponse.SummaryContents)
        System.Console.WriteLine("Title: " + summaryContent.Title);

Calling SearchContent for an organization (by ID) who has an SLA for privileged answer access:

RightNowKnowledgePortClient client = new RightNowKnowledgePortClient();
client.ClientCredentials.UserName.UserName = "user";
client.ClientCredentials.UserName.Password = "AReallyComplicatedPassword";


ClientInfoHeader header = new ClientInfoHeader();
header.AppID = "42";


string interactionID = client.StartInteraction(header, "KFAPITester", "192.168.1.1", null, "KF API Client");


ContentSecurityOptions security = new ContentSecurityOptions();
security.Organization = new NamedID();
security.Organization.ID = new ID();
security.Organization.ID.id = 1;
security.Organization.ID.idSpecified = true;


SearchResponse searchResponse = client.SearchContent(header, interactionID, "test", null, false, false, 10, null, security, null, 0);


if (searchResponse.SummaryContents != null)
    foreach (SummaryContent summaryContent in searchResponse.SummaryContents)   
               System.Console.WriteLine("Title: " + summaryContent.Title

Calling SearchContent for an organization (by Name) who has an SLA for privileged answer access:

RightNowKnowledgePortClient client = new RightNowKnowledgePortClient();
client.ClientCredentials.UserName.UserName = "user";
client.ClientCredentials.UserName.Password = "AReallyComplicatedPassword";


ClientInfoHeader header = new ClientInfoHeader();
header.AppID = "42";


string interactionID = client.StartInteraction(header, "KFAPITester", "192.168.1.1", null, "KF API Client");


ContentSecurityOptions security = new ContentSecurityOptions();
security.Organization = new NamedID();
security.Organization.Name = "org with sla";


SearchResponse searchResponse = client.SearchContent(header, interactionID, "test", null, false, false, 10, null, security, null, 0);


if (searchResponse.SummaryContents != null)
    foreach (SummaryContent summaryContent in searchResponse.SummaryContents)  
                   System.Console.WriteLine("Title: " + summaryContent.Title);

 

Learn more about Service Level Agreements SLAs and how to set them up:

Applying SLAs to an organization or contact

Setting up service level agreements (SLAs)