Web API Reference Guide > Available API Methods > Z-Ray Methods > The zrayCreateAccessToken Method

The zrayCreateAccessToken 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

Yes

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

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>

</accessToken>

</responseData>

</zendServerAPIResponse>

 

Read Also

  Available API Methods    
  Z-Ray Methods