{"__v":3,"_id":"56094af131beb60d001b65db","category":{"__v":7,"_id":"56052058e266000d008971c7","pages":["5605215df6b86e0d00284ab5","56052995d5c3900d0003e83d","56056243e266000d0089720e","56056496f6b86e0d00284b09","56094876c5cff70d007d016a","5609493a31beb60d001b65d9","56094af131beb60d001b65db"],"project":"547cd7662eaee50800ed1089","version":"547cd7662eaee50800ed108c","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-25T10:22:16.805Z","from_sync":false,"order":8,"slug":"public-api","title":"Public API"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"547cd7662eaee50800ed1089","user":"547cd6ac78fd57080023ca99","version":{"__v":9,"_id":"547cd7662eaee50800ed108c","project":"547cd7662eaee50800ed1089","createdAt":"2014-12-01T21:02:30.851Z","releaseDate":"2014-12-01T21:02:30.851Z","categories":["547cd7672eaee50800ed108d","54c8f8ae0174630d00efa874","54c8f8bd7a11f60d0022a832","54c8f8c60174630d00efa876","54c8f8f10174630d00efa877","55155826bc466623002afe83","551558324c7c1e39003735a0","56052058e266000d008971c7","57909a453b845d0e006a37d5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-28T14:13:05.096Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"curl -H \"Authorization:Token b98f08d1c44cd5259dd70dc295e61187af45bffd23036f909919e608bdd8a592\" -i -X POST -d '{\"data\":{\"license_type_id\":26}}' \"https://public-api.devmate.com/v2/customers/45/licenses\"","language":"curl"}]},"results":{"codes":[{"status":201,"language":"json","code":"{\n  \"data\": {\n    \"license_type_name\": \"MyNewApp Single User License\",\n    \"license_type_id\": 26,\n    \"invoice\": \"\",\n    \"campaign\": \"\",\n    \"activations_used\": 0,\n    \"id\": 1185,\n    \"expiration_date\": null,\n    \"products\": [\n      {\n        \"id\": 1,\n        \"name\": \"MyNewApp\",\n        \"bundle_id\": \"com.acme.MyNewApp\",\n        \"use_offline_license\": false\n      }\n    ],\n    \"is_subscription\": false,\n    \"status\": 1,\n    \"activations_total\": 65535,\n    \"activation_key\": \"id593311373237odr\",\n    \"history\": [\n      {\n        \"type\": 2,\n        \"user_name\": \"\",\n        \"note\": \"\",\n        \"timestamp\": 1446563864\n      }\n    ]\n  }\n}","name":""},{"status":400,"language":"json","code":"{\n    \"errors\": [\n        {\n            \"title\": \"Invalid field \\\"customer_id\\\".\",\n            \"detail\": \"Mandatory parameter \\\"customer_id\\\" is empty.\"\n        }\n    ]\n}","name":"Wrong customer ID"},{"code":"{\n    \"errors\": [\n        {\n            \"title\": \"Invalid field \\\"license_type_id\\\".\",\n            \"detail\": \"Wrong \\\"license_type_id\\\" parameter given. License type #123 not found.\"\n        }\n    ]\n}","language":"json","status":400,"name":"Wrong license ID"}]},"settings":"","auth":"required","params":[{"_id":"560a8c36f6994b0d0023bc3f","ref":"","in":"path","required":false,"desc":"Customer ID","default":"","type":"int","name":"customer_id"},{"_id":"56094af131beb60d001b65dd","ref":"","in":"body","required":false,"desc":"The ID of license type in DevMate (see below)","default":"","type":"int","name":"data[license_type_id]"}],"url":"/customers/:customer_id/licenses"},"isReference":false,"order":4,"body":"This method is used to create a license for the specific customer. The ID of customer needs to be passed in the URL of the request (`customer_id`). For example:\n\n````\nhttps://public-api.devmate.com/v2/customers/45/licenses\n````\nthis request will create a license for the customer with ID `45`.\n\nLicense ID can be found in DevMate Dashboard under *App Settings > License Types*.\n\nDescription of response fields see [here](doc:get-customers). \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/cbRHrslhT8CjhBKb1kMn_License_type_id.png\",\n        \"License_type_id.png\",\n        \"1000\",\n        \"579\",\n        \"#fc1c15\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nIn case of success, you will receive an activation number within the server response, so you may provide it to your customer.\n\nExample shows the creation of license with ID 26.\n\n#Response Codes\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`201`\",\n    \"0-1\": \"License was successfully created\",\n    \"1-0\": \"`400`\",\n    \"1-1\": \"Bad request. Customer id was not specified or incorrect or wrong license id provided\",\n    \"2-0\": \"`401`\",\n    \"2-1\": \"Authorization failed\",\n    \"3-0\": \"`500`\",\n    \"3-1\": \"Server error\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","excerpt":"","slug":"create-license-for-customer","type":"post","title":"Create License for Customer"}

postCreate License for Customer


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

customer_id:
integer
Customer ID

Body Params

data[license_type_id]:
integer
The ID of license type in DevMate (see below)

Examples


Result Format


Documentation

This method is used to create a license for the specific customer. The ID of customer needs to be passed in the URL of the request (`customer_id`). For example: ```` https://public-api.devmate.com/v2/customers/45/licenses ```` this request will create a license for the customer with ID `45`. License ID can be found in DevMate Dashboard under *App Settings > License Types*. Description of response fields see [here](doc:get-customers). [block:image] { "images": [ { "image": [ "https://files.readme.io/cbRHrslhT8CjhBKb1kMn_License_type_id.png", "License_type_id.png", "1000", "579", "#fc1c15", "" ] } ] } [/block] In case of success, you will receive an activation number within the server response, so you may provide it to your customer. Example shows the creation of license with ID 26. #Response Codes [block:parameters] { "data": { "0-0": "`201`", "0-1": "License was successfully created", "1-0": "`400`", "1-1": "Bad request. Customer id was not specified or incorrect or wrong license id provided", "2-0": "`401`", "2-1": "Authorization failed", "3-0": "`500`", "3-1": "Server error" }, "cols": 2, "rows": 4 } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}