• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Roach
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    Roach

    @Roach

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Roach Unfollow Follow

    Latest posts made by Roach

    • RE: Python API authentication

      @tom-elliott Hi, thanks for the reply.

      Im getting the following errors : in CMD :

      curl: (6) Could not resolve host: NjhmN2VkNmFiZWVmZGQ4NjNhNGYyMzAwYmEyZGY4MWMwYzdhZGFmZjQyZjI0Yzc0Mjc1NzNmYWE1MjVlMzBjODM5MTE2YjZlODJhNjNhZmFiMzg1NGU3NmM1MjQzMDc4M2FjYTU0NGExMWQ2NWQxxxxMWJlZjQ’
      curl: (6) Could not resolve host: MTM3OWM1YjczZjI3OGZlNmVjNjk0MWQwYTUzOTljNTFjOTc0YmE0OWRiMjQ5MzhhOGE0ZGM4ODRjZjFkOWI2MzI3NjNlYzMxYTY4MWJhNjEzOTFmMWY3OTEwMDJmNTUwM2Q1NTNjMjlhZTA5NmQ3xxxxNDU’

      and in powershell console :

      Invoke-WebRequest : Cannot bind parameter ‘Headers’. Cannot convert the "fog-api-token:

      But nevermind, thanks for the support but im throwing in the towel. Guess this is just 1 of those things thats to complicated for me. Hoped it was simple, but im getting errors left and right. Thanks for your time. Dont waste anymore on me 🙂

      posted in General Problems
      R
      Roach
    • Python API authentication

      Hi,

      Going nuts over here, maybe overlooking a setting ? i have no idea.

      I enabled the API at settings, copied the API key.
      I enabled the API on fog user account, copied the API key.

      I use this in the following script i took from somewhere over here and imputted my API keys:

      import requests

      usertoken=‘MTM3OWM1YjczZjI3OGZlNmVjNjk0MWQwYTUzOTljNTFjOTc0YmE0OWRiMjQ5MzhhOGE0ZGM4ODRjZjFkOWI2MzI3NjNlYzMxYTY4MWJhNjEzOTFmMWY3OTEwMDJmNTUwM2Q1NTNjMjlhZTA5NmQxxxxxxllYjdjNDQ2YTBmNDU=’
      apitoken=‘NjhmN2VkNmFiZWVmZGQ4NjNhNGYyMzAwYmEyZGY4MWMwYzdhZGFmZjQyZjI0Yzc0Mjc1NzNmYWE1xxxE2YjZlODJhNjNhZmFiMzg1NGU3NmM1MjQzMDc4M2FjYTU0NGExMWQ2NWQ4ODEzOTgzMGRkNGY5MWJlZjQ=’
      headers = {‘fog-user-token’: usertoken, ‘fog-api-token’:apitoken }
      r = requests.get(‘http://x.x.x.x/fog/task/current’, params=headers)

      print(r.url)

      Im getting back : <Response [403]>

      is there a hidden setting somewhere ? i dont get it.

      posted in General Problems
      R
      Roach