The zrayCreateAccessToken Web API Method

Generate a random access token for use in the Z-Ray Secured Access mode.

Version: 1.8

Required Permissions: Full

HTTP method: POST

Supported Editions: Zend Server

Request parameters:

Parameter

 Type

Required

Description

iprange

String

Yes

IP Range allowed access to Z-Ray with this token. The iprange can be any IP address or CIDR range.

baseUrl

String

No

Limit access with Z-Ray to a specific base URL. Z-Ray and its activities will only be active on this specific base URL and any sub-paths. If no baseUrl is specified, this token will not be limited to a specific baseUrl.

ttl

Integer

No

Limit this token’s access to expire after the given time in seconds is passed.

inject

Boolean

No

If this is set (True), Z-Ray toolbar will be "injected" and delivered with the web page output.

title

String

No

Title, name or description of the access token. This field is not used for anything but display.

Expected Response Code: 200 OK. For more information see Response Format.

Response Format: accessToken

Possible Action Specific Error Codes: This action has no specific error codes

Example

Usage Example

Request (headers removed for the purpose of clarity)

POST /ZendServer/Api/zrayCreateAccessToken

iprange=127.0.0.1,10.0.0.0/8&baseUrl=http://example.com&ttl=1401437248

Response (not all headers are shown)

<?xml version="1.0" encoding="UTF-8"?>

<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.8">

<requestData>

<apiKeyName>angel.eyes</apiKeyName>

<method>zrayCreateAccessToken</method>

</requestData>

<responseData>

<accessToken>

<tokenId>2</tokenId>

<hash><![CDATA[...]]></hash>

<iprange><![CDATA[...]]></iprange>

<baseUrl><![CDATA[...]]></baseUrl>

<ttl>...</ttl>

<title><![CDATA[...]]></title>

</accessToken>

</responseData>

</zendServerAPIResponse>