Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This User Creation (REST) API is called with a payload of the user information from the a third party provider's contact screen. The web application will run validations and create the user after the validations are passed. An option in the payload is to specify whether a welcome email is to be sent to the user. Password is set via link in the email.


NOTE - This API creates a user against an existing Customer so the customer code must already exist.

...

  • The ClientID and ClientSecret: Commerce Vision will provide these to you)


1. Open your Postman app.


2. Set the request type to 'POST'. 3. In Access Token URL, enter the URL (given to you). 


4. Add the client Client ID and Client Secret provided to you.

...

  • Token Type: this is the authorisation type that is needed for the api calls (should be 'bearer' usually)
  • Access Token: this is the actual token

2. Make the API call

(note to self- waiting for data)

You will need:

  • The Token API endpoint: /api/token
  • The API endpoint: /api/user 

...

The Token Type and Access  Token you created are needed to make the API call. The API endpoint requires use of the token type and token in the authorisation header.


1. Set the request type to 'POST'. 


2. Enter the URL (domain name) and then add /api/user

Image Added

The API request returns the headers and payload in JSON.


3. In the Authorizations tab, select 'OAuth 2.0'

Image Added


4. In the Body tab, select Raw, then JSON.

Image Added



NOTE - The response object should contain a response that allows you to see whether the call succeeded and whatever response information the call will return. All responses should contain "Success" and may contain "Message" (it should have the field but might have no content depending on the service). All other fields on the response object are endpoint specific.

{
    "EmailAddress" : "jwwishart-does-not-exist",
    "FirstName" : "Justin",
    "Surname" : "Wishart",
    "PhoneNumber" : "041939393939",
    "NotifyEmailAddress" : "justin.

...

wishart+test@commercevision.com.au",
    "CustomerCodes" : [
        "046008",
        "046018"
    ],
    "SendWelcomeEmail": false
}