Jump to content

Storing the response from an API


Go to solution Solved by paddy_fields,

Recommended Posts

May be missing something simple here, but I've written a CURL script to post data to Reed.co.uk (job board). Reed returns the text 'SUCCESS JobID=1' which is to show it is working... which is great.

 

Problem is I want to be able to now use that JobID and put the details into my database after the CURL request is sent, but I can't see how I would store the '1' as a variable? Would this even be possible as it is the Reed server just outputting text?

Edited by paddyfields
Link to comment
https://forums.phpfreaks.com/topic/287430-storing-the-response-from-an-api/
Share on other sites

  • Solution

Worked it out :pirate:

curl_setopt($ch, CURLOPT_URL, 'https://www.reed.co.uk/recruiter/HttpManagement.aspx');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
Edited by paddyfields
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.