saranraj456

updated

4 years ago

S

saranraj456

1 Rookie

108 Posts

0

1891

August 9th, 2022 06:00

Powerflex manager rest API Authenticate sample

Hello, 

 

do we have any sample for powerflex manager rest api call ? i am struggling at the first step of authentication

/Api/V1/Authenticate 

I checked in powerflex manager API guide and developer portal - https://developer.dell.com/apis/5468/versions/3.8/docs/Getting%20Started/Authentication.md,

no clear information on it. Can anyone please help to get the sample or right syntax ?

saranraj456_0-1660051834451.png

 

 

  • jennifer_john

    1 Rookie

    79 Posts

    1504

    1

    Posted August 10th, 2022 03:00

    Hi @saranraj456 

    The Content-Type header for the request need to be set as application/json. Please find below screenshot of the api execution

    curl.png

    Thanks,

    Jennifer

  • saranraj456

    1 Rookie

    108 Posts

    1500

    0

    Posted August 10th, 2022 04:00

    Thanks Jennifer , Authentication worked. Is there a way to run the GET call directly without using any programming language ( as like below) .  Deriving the customized header seems to be a complex step.  I would like to get the managed device IP information using this URI- /Api/V1/ManagedDevice/

     

    apiKey = '34b3577f7c3c03174a9a506b'
    apiSecret = '9a6d9692ba64142e6a1934f9be994f3b0ae63959a6132c8b'
    timestamp = Time.now.to_i.to_s
    
    # Concatenate the following values
    requestString = "%s:%s:%s:%s:%s" % [apiKey,httpMethod,uriPath,userAgent,timestamp]
    
    # Compute a digest on concatenated string using apiSecret
    hash_str = OpenSSL::HMAC.digest('sha256',apiSecret,requestString)
    signature = Base64.strict_encode64(hash_str)
    
    headers['x-dell-auth-key'] = apiKey
    headers['x-dell-auth-signature'] = signature
    headers['x-dell-auth-timestamp'] = timestamp

     

  • jennifer_john

    1 Rookie

    79 Posts

    1470

    0

    Posted August 11th, 2022 10:00

    Hi @saranraj456 ,

    As per documentation, the signature header need to be set which is a hashcode generated with OpenSSL, which would require a script.

    Thanks,

    Jennifer