1

I am working with an API from SignalHire. The API docs reference a callback URL but I don't have a very technical background and am not sure how to set this up. I've done some digging but I am still very confused and not sure how to proceed. Here is my code:

API_KEY = 'testapikey'
headers = {'apikey': API_KEY,
           'callbackUrl': ''}

data = {'items': ['https://www.linkedin.com/in/testprofile/']}
response = requests.post("https://www.signalhire.com/api/v1/candidate/search", headers=headers, json=data)

if response.status_code == 200:
    print(json.dumps(response.json(), sort_keys=True, indent=4))

I just need help understanding what a callback url is and how I can set that up.

codr
  • 51
  • 8

1 Answers1

1

When you post the search request, you won't get back results immediately. Instead, you'll get a 201 response that lets you know that SignalHire has received your request.

When the results are ready, they will be posted to the the URL you provide. It should be an endpoint that you write that sends a 200 response back to SignalHire acknowledging that it has received the search results.

chepner
  • 497,756
  • 71
  • 530
  • 681
  • Can the URL be locally hosted? – codr Aug 27 '21 at 19:54
  • It can be hosted wherever you like. SignalHire doesn't care; it just wants a URL it can post the results to. It's like writing a function that takes an open file handle as an argument: the function doesn't care where it is (or even if it's a real file, rather than some other file-like object), as long as it can write to it. – chepner Aug 27 '21 at 19:57
  • how would I set up a local server that SignalHire could write to? Sorry I'm very ignorant to this. – codr Aug 27 '21 at 20:11
  • That's far beyond the scope of this site. – chepner Aug 27 '21 at 20:12
  • Do you know of any resources that could give me some direction? – codr Aug 27 '21 at 20:19