REST API: Setup

This page documents the REST API feature available as of v1.8.10.0 of MageRewards for Magento.
Documentation for the deprecated SOAP API feature, can be found here.

Outline

Setup

Before starting, note that minimum requirements for REST API support in Magento 1.x are Magento Enterprise 1.12 or Magento Community 1.7.

Magento 1.x uses OAuth 1.0a Authentication for it's REST API. To allow an external system to access REST resources, you must take a few steps in the Magento Admin panel:

  1. Create oAuth Consumer
  2. Create Admin REST Role
  3. Configure Resource Attributes
  4. Assign REST Role

1. Create oAuth Consumer

First you'll need to introduce the new integration to Magento.

  1. Navigate to System → Web Services → REST oAuth Consumers.
  2. Click "Add New" to add a consumer entry.
  3. Enter a "Name" for the application you wish to integrate.
  4. Copy & Paste the pre-populated "Key" and "Secret" values. You'll need these later.
  5. Enter a "Callback URL" and "Rejected Callback URL" if you're integration requires this. Ignore otherwise.
  6. Enter "Current Admin Password" if prompted.
  7. "Save".

2. Create Admin REST Role

You'll need to have an Admin Role available to the REST service so that your integration can act as an Admin.

  1. Navigate to System → Web Services → REST Roles.
  2. Click "Add admin Role".
  3. Enter a "Role Name" for the new role. Example: RESTadmin
  4. Enter "Current Admin Password" if prompted.
  5. Click on the "Role API Resources" tab.
  6. To allow your integration access to MageRewards Rewards features, select it's resources from the list.
    You may also choose to give full privileges to the new role by selecting "All" under "Resource Access".
  7. Click "Save Role".


3. Configure Resource Attributes

Next you'll need to specify which attributes of what resources Admins, Customers or Guests will have access to.

  1. Navigate to System → Web Services → REST attributes.
  2. Click on "Admin" (since all MageRewards API Resources are only accessible to admins).
  3. Select "All" under "Resource Access".
  4. Click "Save".


4. Assign REST Role

Last step is to assign the REST Role to a specific Admin user account.

  1. Navigate to System → Permissions → Users.
  2. Pick an Admin user from the list. API Access will happen on behalf of this user. Example admin
  3. On the "Edit" screen, select the "REST Role" tab on the left.
  4. Pick the Admin Role you created previously.
  5. Click "Save User".

Still need help? Get Help Get Help