I am trying to call other API using POST method. Also sending API key and session token in header. But it is returning error “Bad request. No token or api key provided.”. Following is my code:
$options = [];
$options[‘headers’] = [];
$options[‘headers’][‘Content-Type’] = ‘application/json’;
$options[‘headers’][‘X-DreamFactory-Api-Key’] = $platform[‘session’][‘api_key’];
$options[‘headers’][‘X-DreamFactory-Session-Token’] = $platform[‘session’][‘session_token’];
$api= $platform[“api”];
$post= $api->post;
$result = $post($url, $postbody,$options);
Can anyone please tell me what is wrong in above code?