B2B Integration

 View Only
  • 1.  User creation via command line

    Posted Mon February 13, 2023 09:58 AM

    Hi all, 

    Is it possible to create a user from the command line instead of using the b2bi UI and clicking through the prompts / pages?  I was doing some searching and haven't really found any commands to do so.  I'm new to b2bi so if it's possible to do it's a very high possibility that I looked past it.

    For clarification I'm talking about creating a new user from Sterling B2B Integrator UI --> Accounts --> User Accounts --> "Create a new Account / Go" screen.

    Thanks in advance!

    Nick



    ------------------------------
    Nicholas Murn
    Leveraging Techology
    Rochester NY
    585-454-4250 x 116
    ------------------------------

    #SupplyChain
    #B2BIntegration


  • 2.  RE: User creation via command line

    Posted Tue February 14, 2023 06:01 AM

    Hi Nick,

    You can do it via REST: https://www.ibm.com/docs/en/b2b-integrator/6.1.2?topic=cbra-b2b-rest-apis-available-in-sterling-b2b-integrator

    So you could call curl from the command line to send the REST requests.

    Regards,

    Richard.



    ------------------------------
    RICHARD CROSS
    ------------------------------



  • 3.  RE: User creation via command line

    Posted Tue February 14, 2023 10:41 AM

    Richard,

    Awesome!  I knew there was a way but still learning my way around the product.  Thanks for the response.

    Nick



    ------------------------------
    Nicholas Murn
    Lead Consultant
    Eliassen Group
    Rochester VT
    585-270-1330
    ------------------------------



  • 4.  RE: User creation via command line

    Posted Wed February 15, 2023 09:02 AM

    Hi Nick,

    please find here an example on how to create a user with some groups and permissions. please change values underlined and remove unnecessarygroups/permissions.

    /**** Postman ******/

    https://{{ip_address}}:{{port}}/B2BAPIs/svc/useraccounts/

    {
        "authenticationType": {
            "code": "Local",
            "display": "Local"
        },
        "givenName": "Test Operator",
        "groups": [
            {
                "name": "Trading Profiles"
            },
            {
                "name": "Deployment"
            },
            {
                "name": "Business Process"
            },
            {
                "name": "MAILBOX"
            },
            {
                "name": "SERVICES"
            },
            {
                "name": "Mailbox Administrators"
            },
            {
                "name": "MAPS"
            },
            {
                "name": "DEPLOYMENT"
            },
            {
                "name": "EBICS Operators"
            },
            {
                "name": "BPMONITOR"
            },
            {
                "name": "EBICS Administrators"
            }
        ],
        "permissions": [
            {
                "name": "UI Logs"
            },
            {
                "name": "PGP Public Key"
            },
            {
                "name": "PGP Sponsor Manager"
            },
            {
                "name": "UI Licenses"
            },
            {
                "name": "PGP Server Manager"
            },
            {
                "name": "OdetteFTPQueue"
            },
            {
                "name": "UI Reports"
            },
            {
                "name": "PGP Secret Key"
            },
            {
                "name": "Troubleshooter"
            },
            {
                "name": "OdetteFTPCLID"
            },
            {
                "name": "UI Lock Manager"
            },
            {
                "name": "PGP Partner Manager"
            },
            {
                "name": "UI Notify"
            },
            {
                "name": "UI AS3 Trading Profile Setup"
            },
            {
                "name": "Admin Web App Permission"
            },
            {
                "name": "UI Cluster"
            },
            {
                "name": "EBICS Client UI APPLICATION"
            }
        ],
        "preferredLanguage": {
            "code": "en",
            "display": "English"
        },
        "sessionTimeout": 0,
        "surname": "test",
        "password": "password",
        "userId": "user",
        "userIdentity": "DEFAULT Organization"
    }

    /**** cURL ******/

    curl --location --request POST 'https://{{ip_address}}:{{port}}/B2BAPIs/svc/useraccounts/' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'Authorization: Basic xxxxxx=' \
    --data-raw '{
        "authenticationType": {
            "code": "Local",
            "display": "Local"
        },
        "givenName": "Test Operator",
        "groups": [
            {
                "name": "Trading Profiles"
            },
            {
                "name": "Deployment"
            },
            {
                "name": "Business Process"
            },
            {
                "name": "MAILBOX"
            },
            {
                "name": "SERVICES"
            },
            {
                "name": "Mailbox Administrators"
            },
            {
                "name": "MAPS"
            },
            {
                "name": "DEPLOYMENT"
            },
            {
                "name": "EBICS Operators"
            },
            {
                "name": "BPMONITOR"
            },
            {
                "name": "EBICS Administrators"
            }
        ],
        "permissions": [
            {
                "name": "UI Logs"
            },
            {
                "name": "PGP Public Key"
            },
            {
                "name": "PGP Sponsor Manager"
            },
            {
                "name": "UI Licenses"
            },
            {
                "name": "PGP Server Manager"
            },
            {
                "name": "OdetteFTPQueue"
            },
            {
                "name": "UI Reports"
            },
            {
                "name": "PGP Secret Key"
            },
            {
                "name": "Troubleshooter"
            },
            {
                "name": "OdetteFTPCLID"
            },
            {
                "name": "UI Lock Manager"
            },
            {
                "name": "PGP Partner Manager"
            },
            {
                "name": "UI Notify"
            },
            {
                "name": "UI AS3 Trading Profile Setup"
            },
            {
                "name": "Admin Web App Permission"
            },
            {
                "name": "UI Cluster"
            },
            {
                "name": "EBICS Client UI APPLICATION"
            }
        ],
        "preferredLanguage": {
            "code": "en",
            "display": "English"
        },
        "sessionTimeout": 0,
        "surname": "test",
        "password": "password",
        "userId": "user",
        "userIdentity": "DEFAULT Organization"
    }
    '



    ------------------------------
    Emiliano Pacelli
    ------------------------------



  • 5.  RE: User creation via command line

    Posted Tue March 28, 2023 09:36 AM

    Hi Emiliano,

    Just seeing this now, thank you so much!  I'm working on automating the whole b2bi install / config and this will def help!

    Nick



    ------------------------------
    Nicholas Murn
    Lead Consultant
    Eliassen Group
    Rochester VT
    585-270-1330
    ------------------------------



  • 6.  RE: User creation via command line

    Posted Mon April 03, 2023 10:47 AM

    I was able to create users with the above curl commands successfully, thank you so much!

    To piggyback off my original question, is it possible to do everything in the GUI via rest api or are there things that still require manually doing via the UI?

    For example, to do an import / export from Resource Manager, I didn't see anything in the REST interface for that...is that possible to do via any scripts in the ../bin dir?

    Thanks again!



    ------------------------------
    Nicholas Murn
    Lead Consultant
    Eliassen Group
    Rochester VT
    585-270-1330
    ------------------------------



  • 7.  RE: User creation via command line

    Posted Fri April 21, 2023 11:11 AM

    Not quite everything is available as a REST API yet. Each new release has tended to add more and any new UI elements tend to automatically come with equivalent REST APIs. You've also got the older XAPIs which some customers have used to automate config tasks.

    You can automate import/export e.g. using the import and export services (https://www.ibm.com/docs/en/b2b-integrator/6.1.2?topic=l-import-service) in a BP, and then using the workflowlauncher to run the BP from the command line.

    Hopefully someone watching this forum might have some examples they can share.

    Best regards,
    Richard.



    ------------------------------
    RICHARD CROSS
    ------------------------------



  • 8.  RE: User creation via command line

    Posted Tue May 09, 2023 03:35 PM

    Richard,

    Thanks for the good info once again.  I'll take a look at the provided docs.

    Cheers!
    Nick



    ------------------------------
    Nicholas Murn
    Lead Consultant
    Eliassen Group
    Rochester VT
    585-270-1330
    ------------------------------



  • 9.  RE: User creation via command line

    Posted Mon April 17, 2023 09:45 AM

    Thanks for this interesting information!



    ------------------------------
    Jack Miles
    ------------------------------