Skip to main content

Connection from integromat to cpanel API with API Tokens

Comments

10 comments

  • cPRex Jurassic Moderator
    Hey there! While I can't comment on the site code, can you try running this manually like the example from the docs page to see if that works? curl -H'Authorization: cpanel username:APITOKEN' '
    0
  • Ram Freedman
    Hi @cPRex, Thanks for your reply. Sadly I don't know how to run the curl command directly. Should I use it with CMD and just add the command? The username:APITOKEN should be username:APITOKEN or my Cpanel username:APITOKEN ? When I'm already logged in to my cpanel I can run the command directly from the web browser without using APITOKEN without a problem problem:
    0
  • cPRex Jurassic Moderator
    Great - so at least that indicates the command is working well. Your user may not have command line access, so you may not have that option on your side. It would be the cPanel username of your account, which looks like it could be "shira" from the output you provided.
    0
  • Ram Freedman
    Yes - the command is working well when using it via the browser and while logged in to cpanel. The problem is when I'm trying to use the API with APITOKEN via integromat. I tried using a online curl tool like that Run Curl Commands Online and I get the same problem: Also when running it I'm getting this error: Any I deas? Thanks!
    0
  • Ram Freedman
    I tried some more using the online toll and this is the relevant curl commands that works ( I Had to add a space between the -H
    to the 'Authorization
    and also add cpanel
    before my username: curl -H 'Authorization: cpanel psifascoil:XXXXXXXXXXXXXXXXXX' '
    0
  • cPRex Jurassic Moderator
    I was doing to say, there needs to be a space after the "-H" portion of the command. I'm glad at least that portion is working, although I don't have much advice for the Integromat side of things, unfortunately.
    0
  • Ram Freedman
    In integromat I can send HTTP requests and select: The URL, Method (GET / POST etc.), Headers, Query String, Body type (application/x-www-form-urlencoded or RAW or multipart/form-data) and the Fields of the body. Any I dea how can I convert the CURL command to each part? Thanks!!
    0
  • cPRex Jurassic Moderator
    Unfortunately I don't - that's more of a developer question. Does that application offer any support you could take advantage of to see if they could implement that option?
    0
  • Ram Freedman
    Dear @cPRex Thanks for your help. The solution was to add everything as one value in the header instead of 2. So instead of having Authorization: cpanel and another one of username:token I used: Authorization in the Value field and cpanel username:token in the Name filed. Now it's working. Thanks for your help!
    0
  • cPRex Jurassic Moderator
    I'm glad that's working well now!
    0

Please sign in to leave a comment.