Integrate 1Password with PHP

System
edited April 2021 in Secrets Automation
This discussion was created from comments split from: Web Authentication API support in.

Comments

  • charlessamuel733
    charlessamuel733
    Community Member
    edited April 2021

    Hello Team,

    can we integrate 1password api with php?

    If Yes then, can you share how to integrate with core php and can you share with documentation.

  • ag_yaron
    ag_yaron
    1Password Alumni

    Hey @charlessamuel733 ,

    The original discussion you replied to wasn't related to your question so I've split it into a new discussion.
    I'm not quite sure I fully understand what you are trying to do by integrating 1Password with PHP. Do you mean that you want to be able to read/write/fetch 1Password data using PHP?

    If so, you might find our command line tool helpful as it will give you the ability to build scripts that interact with your 1Password database: https://support.1password.com/command-line-getting-started/

  • charlessamuel733
    charlessamuel733
    Community Member
    edited April 2021

    Hello Team,

    can we integrate 1password REST API with php?

    If Yes then, can you share how to integrate with core php and can you share with documentation.

    We have used in API for now so it is possible?

    We have check the below document but it not work.
    https://support.1password.com/connect-api-reference/

  • rohannagar
    rohannagar
    Community Member
    edited April 2021

    You need to use that documentation to make HTTP calls to the API from your PHP code. Here's some ideas on how to call an API in PHP: https://stackoverflow.com/questions/9802788/call-a-rest-api-in-php

    Make sure you deploy a 1Password Connect server to make calls to: https://support.1password.com/connect-deploy-docker

  • Hey everyone! Thanks for the interest in an official PHP SDK.

    We're tracking interest right now but I can assure you it's on our internal roadmap.

  • charlessamuel733
    charlessamuel733
    Community Member
    edited April 2021

    Hello team,

    @rohannagar

    Thanks for your suggestion.

    But my question is Can we integrate 1password REST API with PHP? Not for simple curl API.

    Can we integrate 1password REST API with php?

    We have checked the below document but API not working. He returns HTML only.
    https://support.1password.com/connect-api-reference/

  • Carson_1P
    Carson_1P
    1Password Alumni

    Hey @charlessamuel733,

    It looks like you're trying to make API requests to 1Password.com directly. The Secrets Automation functionality involves running a lightweight service, called Connect, in an environment you control. That's where your API client would make requests to. As @rohannagar mentioned, you can deploy that service via docker (or kubernetes) after configuring it on 1Password.com

  • mcgeemp
    mcgeemp
    Community Member

    @Carson_1P, is this direct approach not possible? This is exactly what I am attempting to do myself, test with Postman and implement directly in my software reaching out to to your API. Is this possible?

  • Hi mcgeemp,

    Unfortunately there is no REST API available at 1Password.com. Because of our end to end encryption model the 1password.com server does not have the ability to decrypt and serve your data.

    The purpose of the Connect server is to securely sync your encrypted data onto a machine you control and do the decryption.

  • captbackfire
    captbackfire
    Community Member

    +1 for official PHP SDK

  • ag_yaron
    ag_yaron
    1Password Alumni

    Thanks for adding your voice on the matter @captbackfire !

This discussion has been closed.