Support #13002
closedHow to use custom foreman api with PHP
Description
I want to use foreman api (compute_resources) with php language . If i am try to use this api directly then it always logout me from the foreman due to authenticity token. How can i generate the authenticity token in php so that i can use api of foreman with PHP.
Thanks
Updated by Dominic Cleal over 8 years ago
- Priority changed from Urgent to Normal
The API doesn't require an authenticity token, only the UI. Suggests you're hitting the wrong URL or doing something else - hard to help without any data or logs though.
Please use the mailing lists and IRC for support requests, see http://theforeman.org/support.html for more information.
Updated by Parveen Saini over 8 years ago
Dominic Cleal wrote:
The API doesn't require an authenticity token, only the UI. Suggests you're hitting the wrong URL or doing something else - hard to help without any data or logs though.
Please use the mailing lists and IRC for support requests, see http://theforeman.org/support.html for more information.
Thanks for reply
Updated by Parveen Saini over 8 years ago
Parveen Saini wrote:
Dominic Cleal wrote:
The API doesn't require an authenticity token, only the UI. Suggests you're hitting the wrong URL or doing something else - hard to help without any data or logs though.
Please use the mailing lists and IRC for support requests, see http://theforeman.org/support.html for more information.
Thanks for reply
i had install foreman at eg https://0.0.0.0 here and after login the foreman if i hit the https://0.0.0.0/api/compute_resources in browser it return json data but if i hit same url in my curl or ajax then it logout the whole system and return the error unable to authenticate user.