Skip to content

Configure an API Resource without subscription

By configuring an API resource without subscription, an API publisher can allow consumers to access an API resource without subscribing to the API. However, a valid user token is required for authentication.

Prerequisites:

The API proxy must be already configured before creating an API resource for it.

Get Access Token

Get access token

  1. Log in to the Trimble Cloud Console.
  2. On the home page, click your profile displayed at the top-left corner.

The User Profile page displays with the GET ACCESS KEYS button.

3. Select GET ACCESS KEYS and copy the user token displayed on the Access Keys dialog box.

Configuring an API resource without subscription

  • API CALL:

POST https://{basepath}/core-console/1.0/publisher/api/{apiName}/environment/{environmentName}/whitelist-subscription

  • BASE PATH:

– cloud.api.trimble.com

  • PATH PARAMETERS:

– apiName: Name of the API under which the resource will be configured. API name must be appended with the version no. For example, testproxy-v1.

The version number attached to the API Name. Your API name appears in the URL of the API Proxy page.

– environmentName: Indicates dev, qa, stage or prod.

  • HEADERS:

– Accept: application/json

This may be automatically added by your development tool. Postman and curl add this header to all requests.

– Authorization: Bearer {bearer token}.

Include the User Access Token.

  • BODY PARAMETERS:

– resourceVerb: Appropriate HTTP Verb

– resourcePath: Path to the resource (object)

  • EXAMPLE:
    [
      {
        "resourceVerb": "GET",
        "resourcePath": "/user/callback"
      },
      {
        "resourceVerb": "GET",
        "resourcePath": "/user/error"
      }
     ]

Wildcard entries are not supported, for example /user/callback/*. You must configure the exact resource names in the call.

Get the configured resource ID

  • API CALL:

GET https://{basepath}/ore-console/1.0/publisher/api/{apiName}/environment/{environmentName}/whitelist-subscription

  • BASE PATH:

– cloud.api.trimble.com

  • HEADERS:

– Accept: application/json

This may be automatically added by your development tool. Postman and curl add this header to all requests.

– Authorization: Bearer {bearer token}.

Include the User Access Token.

  • PATH PARAMETERS:

– apiName: Name of the API under which the resource will be configured. API name must be appended with the version no. For example, testproxy-v1.

The version number attached to the API Name. Your API name appears in the URL of the API Proxy page.

– environmentName: Indicates dev, qa, stage or prod.

– whitelist-subscription-id: Resource ID of the configured resource. You can get this from the GET call explained in the above step “Get the Configured Resource ID”.

  • RESPONSE:

Any array of Resource IDs is returned.

Edit an already configured resource

  • API CALL:

PUThttps://{basepath}/core-console/1.0/publisher/api/{apiName}/environment/{environmentName}/whitelist-subscription/{whitelist-subscription-id}

  • BASE PATH:

– cloud.api.trimble.com

  • PATH PARAMETERS:

– apiName: Name of the API under which the resource will be configured. API name must be appended with the version no. For example, testproxy-v1.

The version number attached to the API Name. Your API name appears in the URL of the API Proxy page.

– environmentName: Indicates dev, qa, stage or prod.

– whitelist-subscription-id: Resource ID of the configured resource. You can get this from the GET call explained in the above step “Get the Configured Resource ID”.

  • HEADERS:

– Accept: application/json

This may be automatically added by your development tool. Postman and curl add this header to all requests.

– Authorization: Bearer {bearer token}.

Include the User Access Token.

  • BODY PARAMETERS:

– resourceVerb: Appropriate HTTP Verb

– resourcePath: Path to the resource (object)

  • EXAMPLE
    {
        "resourceVerb": "POST",
        "resourcePath": "/user/me"
    }

After you edit the resources, it may take upto 2 mins to reflect any changes.

Delete the safe listed resource

  • API CALL:

DELETEhttps://{basepath}/core-console/1.0/publisher/api/{apiName}/environment/{environmentName}/whitelist-subscription/{whitelist-subscription-id}

  • BASE PATH:

– cloud.api.trimble.com

  • PATH PARAMETERS:

– apiName: Name of the API under which the resource will be configured. API name must be appended with the version no. For example, testproxy-v1.

The version number attached to the API Name. Your API name appears in the URL of the API Proxy page.

– environmentName: Indicates dev, qa, stage or prod.

– whitelist-subscription-id: Resource ID of the configured resource.. You can get this from the GET call explained in the above step “Get the Configured Resource ID”.

  • HEADERS:

– Accept: application/json

This may be automatically added by your development tool. Postman and curl add this header to all requests.

– Authorization: Bearer {bearer token}.

Include the User Access Token.