Community
 
 
 

CloudPortal Business Manager 2.x

324 seguidores
 
Avatar
yesid Mora

BSS API CPBM

Hello, I need use the API to CPBM, the version is 2.2.1 and I see the information 

 

http://support.citrix.com/proddocs/topic/cpbm-21-map/cpbm-21-bssapi-wrapper-con.html

http://shapeblue.com/citrix/working-with-the-citrix-cloudportal-business-manager-2-1-bss-api/

 

but not understand How  generate the signature, please help me? is necesary create a script?? or for URL generate the signature??

 

thanks 

 


3 comentários
0

Por favor, entrar para comentar.

 
 

Previous 3 comentários

Avatar
Administrator
Avatar

BSS API CPBM

Hi Yesid,

 

Please find the documentation to generate signtature at: http://support.citrix.com/proddocs/topic/cpbm-22-map/cpbm-generatingsigntre-task.html

 

Thanks,

Manish


Manish Agarwal CITRIX EMPLOYEES
Ações de comentário Permalink
Avatar
yesid Mora

Hello Manish, thanks for your comments please explain how create a signature, because i see the documentation and example but don't know how execute the script or how construct the script for create a signature, and this documentation not have in the link, thanks 


Ações de comentário Permalink
Avatar
Administrator
Avatar

Hi Yesid,

 

Sample java code to create the API URL is as bellow:

      String apiKey = "api.key";// user's API key
      String secretKey = "secret.key"; //user's secret key
      String urlString = "endpoint.url"; // example: http://myhost/portal/api
      String pathString = "api.url"; // example: /account/events?pagesize=1&category=ACCOUNT&source=PORTAL
      String paramString = (pathString.indexOf("?") > -1 && pathString.indexOf("?") < pathString.length() - 1) ? pathString
          .split("\\?")[1] : null;
      String barePathString = pathString.indexOf("?") > -1 ? pathString.split("\\?")[0] : pathString;
      List<String> paramList = new ArrayList<String>();
      if (paramString != null && !paramString.equals("")) {
        paramList.addAll(Arrays.asList(paramString.split("&")));
      }
      paramList.add("apiKey=" + apiKey);
      Collections.sort(paramList);
      String timeStamp = "" + System.currentTimeMillis();
      String parameterString = "_=" + timeStamp;
      for (String str : paramList) {
        if (str != null && !"".equals(str)) {
          parameterString = parameterString + "&" + str;
        }
      }
      return urlString + barePathString + "?"+ parameterString + "&signature="
          + signRequest((barePathString + parameterString.toLowerCase()), secretKey);

 

This will require the sample method "signRequest" as provided in the API documentation at http://support.citrix.com/proddocs/topic/cpbm-23-map/cpbm-generatingsigntre-task.html.

 

Please note that above is just a sample code and may require some change in order to work properly. And Citrix is not responsible for any mistake in above code.

 

Thanks,

Manish


Manish Agarwal CITRIX EMPLOYEES
Ações de comentário Permalink

Top Contributors