Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    Api-Log funktioniert nicht

    Scheduled Pinned Locked Moved Allgemein
    5 Posts 2 Posters 160 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      smieth
      last edited by

      Ich versuche derzeit die PI einzurichten und bekomme Fehler.
      " This is not a JSON-RPC. The content-type should be application\/json, request method should be "post" and the http body should be a valid json-rpc 2.0 package"

      Aber das Grundproblem ist, dass die API trotz Debug nichts ins Log schreibt.

      Was kann die Ursache dafür sein ?

      MartinVM 1 Reply Last reply Reply Quote 0
      • MartinVM Offline
        MartinV @smieth
        last edited by

        Die Fehlermeldung gab's kürzlich schon mal hier im Forum. Schau mal dort.

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          smieth @MartinV
          last edited by

          @MartinV
          Ja, ich versuche es allerdings über ansible.
          Bin jetzt aber einen Schritt weiter.

          Fehler ist jetzt: message": "Invalid request: Invalid JSON-RPC Version. Use version 2.0"

          Playbook:

          • name: API-Call
            hosts: all
            connection: local
            gather_facts: no

            vars:
            ido_it_api_endpoint: XXX
            ido_it_api_key: YYY
            tasks:

            • name: Send System Information to i-doit API
              uri:
              url: "{{ ido_it_api_endpoint }}"
              method: POST
              headers:
              Content-Type: "application/json"
              jsonrpc: "2.0"
              body_format: json
              body:
              method: "idoit.version"
              params:
              api_key: "{{ ido_it_api_key }}"
              language: "de"
              return_content: yes
              register: api_response

            • name: Show response from API
              debug:
              var: api_response.content

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            smieth @smieth
            last edited by

            Aber essentiell fehlt das Log für die API. Es wird kein Log geschrieben.

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              smieth @smieth
              last edited by

              @smieth

              ok
              body:
              jsonrpc: "2.0"

              dem Body kann man es so mitgeben. Geht.
              Wie gesagt Log geht nicht

              1 Reply Last reply Reply Quote 0
              • First post
                Last post