Project

General

Profile

Actions

Support #13002

closed

How to use custom foreman api with PHP

Added by Parveen Saini over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Triaged:
Fixed in Releases:
Found in Releases:

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

Actions #1

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.

Actions #2

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

Actions #3

Updated by Dominic Cleal over 8 years ago

  • Status changed from New to Resolved
Actions #4

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.

Actions

Also available in: Atom PDF