text: #include <stdlib.h>
  #include <stdio.h>
  #include <ctype.h>
  #include "BaseAPI.h"
  
  #define MAX_NUMBER_LENGTH 16
  #define MAX_BUFFER_LENGTH 4096
  #define intToStr(dst, src) \
      do {\
      char dst[256];\
      snprintf(dst, 256, "%ld", (long int)(src));\
  }while(0)
  
  
  // Retrieve CSRF protection token
  //
  default_crumb_issuer_t*
  BaseAPI_getCrumb(apiClient_t *apiClient)
  {
      list_t    *localVarQueryParameters = NULL;
      list_t    *localVarHeaderParameters = NULL;
      list_t    *localVarFormParameters = NULL;
      list_t *localVarHeaderType = list_createList();
      list_t *localVarContentType = NULL;
      char      *localVarBodyParameters = NULL;
  
      // create the path
      long sizeOfPath = strlen("/crumbIssuer/api/json")+1;
      char *localVarPath = malloc(sizeOfPath);
      snprintf(localVarPath, sizeOfPath, "/crumbIssuer/api/json");
  
  
  
      list_addElement(localVarHeaderType,"application/json"); //produces
      apiClient_invoke(apiClient,
                      localVarPath,
                      localVarQueryParameters,
                      localVarHeaderParameters,
                      localVarFormParameters,
                      localVarHeaderType,
                      localVarContentType,
                      localVarBodyParameters,
                      "GET");
  
      if (apiClient->response_code == 200) {
          printf("%s\n","Successfully retrieved CSRF protection token");
      }
      if (apiClient->response_code == 401) {
          printf("%s\n","Authentication failed - incorrect username and/or password");
      }
      if (apiClient->response_code == 403) {
          printf("%s\n","Jenkins requires authentication - please set username and password");
      }
      //nonprimitive not container
      cJSON *BaseAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
      default_crumb_issuer_t *elementToReturn = default_crumb_issuer_parseFromJSON(BaseAPIlocalVarJSON);
      cJSON_Delete(BaseAPIlocalVarJSON);
      if(elementToReturn == NULL) {
          // return 0;
      }
  
      //return type
      if (apiClient->dataReceived) {
          free(apiClient->dataReceived);
          apiClient->dataReceived = NULL;
          apiClient->dataReceivedLen = 0;
      }
      
      
      
      list_freeList(localVarHeaderType);
      
      free(localVarPath);
      return elementToReturn;
  end:
      free(localVarPath);
      return NULL;
  
  }
  
  