Api specifications



Download 5.13 Mb.
Page21/48
Date31.07.2017
Size5.13 Mb.
#25031
1   ...   17   18   19   20   21   22   23   24   ...   48
int

int

int

int







HTTP/1.1 200 OK

Content-Type: text/xml; charset=utf-8

Content-Length: length












string

base64Binary








SOAP 1.2

POST /FACORPAPI/FAWAPI.asmx HTTP/1.1

Host: localhost

Content-Type: application/soap+xml; charset=utf-8

Content-Length: length










string

string

string

int

int

int

int

int







HTTP/1.1 200 OK

Content-Type: application/soap+xml; charset=utf-8

Content-Length: length












string

base64Binary







Sample Visual Basic.Net Code

Private Sub getImageStream()

Dim FAWAPI As New WebReference.FAWAPI()

Dim wsGetImageStreamResult As webAPITest.WebReference.GetImageStreamResult = FAWAPI.GetMediaStream(Token, ImagePath, SizeType, Width, Height, Zoom, RotateDegree)

If Not wsGetImageStreamResult.ErrorMessage <> String.Empty Then

Response.ContentType = "image/jpeg"

Try


Response.BinaryWrite(wsGetImageResult.ImageBytes)

Catch ex As Exception

End Try

Response.End()



End If

wsGetImageStreamResult = Nothing

FAWAPI = Nothing

End Sub


Arguments

Name

Data Type

Required

Description

Token

String

Yes

The Token ID returned by the last AccountLogin call

ImagePath

String

Yes

The full FilesAnywhere path of the image file in the form \UserVolume\FolderName\ItemName

SizeType

String

No

SizeType of the image file expected after streaming. If not provided default image type considered as "L”

Width

Integer


No

Width in pixels to which image file to be streamed. Ignored if SizeType is not “C”. Default value for Width is 32.

Height

Integer

No

Height in pixels to which image file to be streamed. Ignored if SizeType is not “C”. Default value for Width is 32.

Zoom

Integer

No

Image zoom expected for image in percentage. Ignored if SizeType is not “C”.

RotateDegree

Integer

No

Rotate image by degree provided, possible values 90, 180, 270. Ignored if SizeType is not “C”.

PageNum

integer

No

Image number to be strimmed, applicable only if image type is tif or tiff. Default is 1.

GetImageStreamResult Properties

Name

Data Type

Description

ErrorMessage

String

A description of the error, if any error was encountered while submitting the request for image streaming.

If the GetImageStream call was successful, the ErrorMessage will be blank or null.



ImageBytes


Byte()

Returns Byte() on successful image streaming of imagepath provided.

GetTIFFPageCount

This function returns count of pages present at the TIFF image location specified. Image types supported are tif, tiff.

Syntax

GetTIFFPageCountResult = GetTIFFPageCount (Token, ImagePath)

Usage

User can receive page count for the tif or tiff image path.

The following parameters are needed for calling GetTIFFPageCount:


  • Token. The Token ID returned by the last AccountLogin call.

  • ImagePath. The image file path for which page count is required. The image file path should be formatted like \UserVolume\FolderName\FileName where UserVolume is the FilesAnywhere UserName in which account the image file is present.

SOAP 1.1

POST /FACORPAPI/FAWAPI.asmx HTTP/1.1

Host: localhost

Content-Type: text/xml; charset=utf-8

Content-Length: length

SOAPAction: "http://api.filesanywhere.com/GetTIFFPageCount"










string

string





HTTP/1.1 200 OK

Content-Type: text/xml; charset=utf-8

Content-Length: length












string

int










SOAP 1.2

POST /FACORPAPI/FAWAPI.asmx HTTP/1.1

Host: localhost

Content-Type: application/soap+xml; charset=utf-8

Content-Length: length








string

string





HTTP/1.1 200 OK

Content-Type: application/soap+xml; charset=utf-8

Content-Length: length












string

int





Response>




Sample Visual Basic.Net Code

Private Sub getGetTIFFPageCount()

Dim FAWAPI As New WebReference.FAWAPI()

Dim wsGetTIFFPageCountResult As WebReference.GetTIFFPageCountResult = FAWAPI.GetTIFFPageCount(Token, ImagePath)

If Not wsGetTIFFPageCountResult.ErrorMessage <> String.Empty Then

Response.Write("TIFF page count is: " & wsGetTIFFPageCountResult.PageCount)

End If


wsGetTIFFPageCountResult = Nothing

FAWAPI = Nothing

End Sub
Arguments

Name

Data Type

Required

Description

Token

String

Yes

The Token ID returned by the last AccountLogin call

ImagePath

String

Yes

The full FilesAnywhere path of the image file in the form \UserVolume\FolderName\ItemName


GetTIFFPageCountResult Properties

Name

Data Type

Description

ErrorMessage

String

A description of the error, if any error was encountered while submitting the request.

If the GetTIFFPageCount call was successful, the ErrorMessage will be blank or null.



PageCount


Integer

Returns number of pages found in tiff or tif imagepath provided.

FAWAPIv2 Methods


AccountCreateFreeFromPromotion

This method is available to FA partners, used to create new free (web basic) accounts.



You will need to obtain permission first from FilesAnywhere to activate this feature. Please email support@filesanywhere.com and we will evaluate your request.

Syntax

AccountCreateFreeFromPromotionResult = AccountCreateFreeFromPromotion(API_KEY, PromoCode, EmailAddress, UserName, Password)

Usage

Use the AccountCreateFreeFromPromotion method to create new free (web basic) accounts with an established promotion code. You supply your FilesAnywhere APIKey, the promo code, email address of the new account user, optional username (email address will be used if left blank), optional password (if left blank an email with a temporary password will be sent to the new user).

The following parameters are needed to make the AccountCreateFreeFromPromotion call:



  • APIKey (A Developer API Key. See the “Getting Started” section above, to find out how to obtain a Developer API Key)

  • PromoCode (An identifier for an established promotion). Promotions can provide a discounted rate, grant additional storage space, or provide features like unlimited uploads.

  • EmailAddress (This is the email address of the new user you are creating).

  • Username (This is the username of the new account you are creating). If this is left blank then EmailAddress will be attempted as the Username. Then if the EmailAddress is too long then you will get an error.

  • Password (This is the password of the new user you are creating) If this is left blank, then the user will get an email with a temporary password sent to them.

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /v2/fawapi.asmx HTTP/1.1

Host: api.filesanywhere.com

Content-Type: text/xml; charset=utf-8

Content-Length: length

SOAPAction: "http://api.filesanywhere.com/AccountCreateFreeFromPromotion"








string

string



string

string

string







HTTP/1.1 200 OK

Content-Type: text/xml; charset=utf-8

Content-Length: length












string

boolean







SOAP 1.2

The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

POST /v2/fawapi.asmx HTTP/1.1

Host: api.filesanywhere.com

Content-Type: application/soap+xml; charset=utf-8

Content-Length: length








string

string



string

string

string







HTTP/1.1 200 OK

Content-Type: application/soap+xml; charset=utf-8

Content-Length: length












string

boolean







Sample Visual Basic.Net Code

Private Sub AccountCreateFreeFromPromotion()

Dim FAWAPI As New WebReference.FAWAPI

Dim AccountCreateFreeResult As New WebReference.AccountCreateFreeResult

AccountCreateFreeResult = FAWAPI.AccountCreateFreeFromPromotion(ApiKey,PromoCode,EmailAddress,Username,Password)

If AccountCreateFreeResult.ErrorMessage <> "" Then

Msgbox AccountCreateFreeResult.ErrorMessage

End If

AccountCreateFreeResult = Nothing



FAWAPI = Nothing

End Sub


Request Arguments

Name

Data Type

Required

Description

ApiKey

String

Yes

A Developer API Key. The “Getting Started” section describes how to obtain a Developer API Key

PromoCode

String

Yes

The promotion code representing the promotion to be applied to the newly created account.

EmailAddress

String

Yes

EmailAddress of the user being created.

Username

String

No

Username of user being created. If this is left blank the emailaddress will be attempted. If this is too long (>20 characters) then an error will occur.

Password

String

No

Password of account being created. If this is left blank an email with a temporary password will be sent to the new user.

Response

AccountCreateFreeResult

AccountCreateFreeResult Properties

Name

Data Type

Description

ErrorMessage

String

A description of the error, if any error was encountered while the AccountCreateFreeFromPromotion method was executed. If the AccountCreateFreeFromPromotion call was successful, the ErrorMessage is blank

Result

Boolean

True or False indicating whether the API call was a success or a failure



Download 5.13 Mb.

Share with your friends:
1   ...   17   18   19   20   21   22   23   24   ...   48




The database is protected by copyright ©ininet.org 2024
send message

    Main page