Loading...

Description

Create a new Api Key.


Request URL

POST   https://api.3seventy.com/api/v2.1/account/{accountId}/api-key

Request Properties

Parameter Description Mandatory
accountId The Account to create an Api Key for. Yes
Label User defined identificator Yes
Type Api Key type: 1 for a Common key, 2 for a Temporary key Yes
ValidTo A date and time this key will be valid to. (Applicable for Temporary keys only) No

Response Properties

Property Description
AccountId An account this api key has access to.
Key A key. Used as a login name.
Label User-defined identificator
LastActivity A time of last login.
Secret A secret. Used as a login password.
Type A key type mapping.
TypeId Type of a key.
UserName A user this key is owned by if any. For master keys only.
ValidTo A datetime this key is valid to. For temporary keys only.

C#
PHP


using System;
using System.Collections.Generic;
using System.Linq;
using ThreeSeventy.Vector.Client;
using ThreeSeventy.Vector.Client.Models;

public class Program
{

private static void Main(string[] args)
{

const int accountId = XXXX;

var context = new T70Context();

var apiKeyRepo = context.Repository<ApiKey>(new { AccountId = accountId });

var item = new ApiKey()
{

Label = "XXX",

Type = ApiKeyType.Temporary,

ValidTo = DateTime.Now.AddDays(3)

};

apiKeyRepo.Add(item);

}

}

 

Stay tuned for JAVA code snippet
Stay tuned for RUBY code snippet
Stay tuned for PHP code snippet