companyUrl is returning an array instead of a single string

Forum for users and developers of Bullhorn's API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
gswartz777
User
Posts: 14
Joined: Tue Jun 09, 2020 8:26 am

companyUrl is returning an array instead of a single string

Post by gswartz777 »

We have had a number of our customers use our bullhorn integration with no problems. We use the following code to look up the client corporation for a job.

Code: Select all

var fieldlist = "address,id,name,companyURL";
var url = $@"{credentials.RestLoginInfo.REST_URL}entity/ClientCorporation/{job.clientCorporation.id}?fields={fieldlist}&BhRestToken={credentials.RestLoginInfo.REST_Token}";
var company = GetBullhornRecord<BullhornClientCorporation>(url);

public class BullhornClientCorporation
{
    public int id { get; set; }
    public BullhornAddress address { get; set; }
    public string name {get;set;}
    public string companyURL {get;set;}
    public List<BullhornClientContact> Contacts { get; set; } = new List<BullhornClientContact>();
}
Again, casting the resulting data json to an instance of the BullhornClientCorporation has never been a problem. Here's an example of json we get back when doing so.

Code: Select all

{
  "data": {
    "address": {
      "address1": "100 Main St",
      "address2": null,
      "city": "Canton",
      "state": "Ohio",
      "zip": "44718",
      "countryID": 1,
      "countryName": "United States",
      "countryCode": "US",
      "timezone": "America/New_York"
    },
    "id": 1,
    "name": "test company",
    "companyURL": "www.testcompany.com"
  }
}
We had another customer who wanted to use the integration, so we ran through the normal set up to create a custom tab. When we call the same endpoint to look up a client corporation for this customer we get back the following json that has companyURL as an array.

Code: Select all

{
  "data": {
    "address": {
      "address1": "800 Main St",
      "address2": "Suite 100",
      "city": "Princeton",
      "state": "",
      "zip": "08540",
      "countryID": 1,
      "countryName": "United States",
      "countryCode": "US",
      "timezone": "America/New_York"
    },
    "id": 1217,
    "name": "#####",
    "companyURL": [
      "https://www.#####.net/"
    ]
  }
}
According to the documentation here - http://bullhorn.github.io/rest-api-docs ... orporation - it says it should be a string. Any idea why it's coming back as an array for one customer but a string for everyone else? Thanks.
ytorres
User
Posts: 6
Joined: Wed Feb 17, 2021 12:56 pm

Re: companyUrl is returning an array instead of a single string

Post by ytorres »

Hello,

This is hard to pinpoint the cause of this because it may be that one is on S Release and the others are on Novo. It could be the configuration of the field in the client's private label. If this is an issue for the client I would recommend having the client creating a ticket with support so that we could look deeper into their setup.

Thank you!
Post Reply