github.com/twilio/twilio-go@v1.20.1/rest/chat/v2/docs/CredentialsApi.md (about) 1 # CredentialsApi 2 3 All URIs are relative to *https://chat.twilio.com* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**CreateCredential**](CredentialsApi.md#CreateCredential) | **Post** /v2/Credentials | 8 [**DeleteCredential**](CredentialsApi.md#DeleteCredential) | **Delete** /v2/Credentials/{Sid} | 9 [**FetchCredential**](CredentialsApi.md#FetchCredential) | **Get** /v2/Credentials/{Sid} | 10 [**ListCredential**](CredentialsApi.md#ListCredential) | **Get** /v2/Credentials | 11 [**UpdateCredential**](CredentialsApi.md#UpdateCredential) | **Post** /v2/Credentials/{Sid} | 12 13 14 15 ## CreateCredential 16 17 > ChatV2Credential CreateCredential(ctx, optional) 18 19 20 21 22 23 ### Path Parameters 24 25 This endpoint does not need any path parameter. 26 27 ### Other Parameters 28 29 Other parameters are passed through a pointer to a CreateCredentialParams struct 30 31 32 Name | Type | Description 33 ------------- | ------------- | ------------- 34 **Type** | **string** | 35 **FriendlyName** | **string** | A descriptive string that you create to describe the new resource. It can be up to 64 characters long. 36 **Certificate** | **string** | [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` 37 **PrivateKey** | **string** | [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` 38 **Sandbox** | **bool** | [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. 39 **ApiKey** | **string** | [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. 40 **Secret** | **string** | [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. 41 42 ### Return type 43 44 [**ChatV2Credential**](ChatV2Credential.md) 45 46 ### Authorization 47 48 [accountSid_authToken](../README.md#accountSid_authToken) 49 50 ### HTTP request headers 51 52 - **Content-Type**: application/x-www-form-urlencoded 53 - **Accept**: application/json 54 55 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 56 [[Back to Model list]](../README.md#documentation-for-models) 57 [[Back to README]](../README.md) 58 59 60 ## DeleteCredential 61 62 > DeleteCredential(ctx, Sid) 63 64 65 66 67 68 ### Path Parameters 69 70 71 Name | Type | Description 72 ------------- | ------------- | ------------- 73 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 74 **Sid** | **string** | The SID of the Credential resource to delete. 75 76 ### Other Parameters 77 78 Other parameters are passed through a pointer to a DeleteCredentialParams struct 79 80 81 Name | Type | Description 82 ------------- | ------------- | ------------- 83 84 ### Return type 85 86 (empty response body) 87 88 ### Authorization 89 90 [accountSid_authToken](../README.md#accountSid_authToken) 91 92 ### HTTP request headers 93 94 - **Content-Type**: Not defined 95 - **Accept**: Not defined 96 97 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 98 [[Back to Model list]](../README.md#documentation-for-models) 99 [[Back to README]](../README.md) 100 101 102 ## FetchCredential 103 104 > ChatV2Credential FetchCredential(ctx, Sid) 105 106 107 108 109 110 ### Path Parameters 111 112 113 Name | Type | Description 114 ------------- | ------------- | ------------- 115 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 116 **Sid** | **string** | The SID of the Credential resource to fetch. 117 118 ### Other Parameters 119 120 Other parameters are passed through a pointer to a FetchCredentialParams struct 121 122 123 Name | Type | Description 124 ------------- | ------------- | ------------- 125 126 ### Return type 127 128 [**ChatV2Credential**](ChatV2Credential.md) 129 130 ### Authorization 131 132 [accountSid_authToken](../README.md#accountSid_authToken) 133 134 ### HTTP request headers 135 136 - **Content-Type**: Not defined 137 - **Accept**: application/json 138 139 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 140 [[Back to Model list]](../README.md#documentation-for-models) 141 [[Back to README]](../README.md) 142 143 144 ## ListCredential 145 146 > []ChatV2Credential ListCredential(ctx, optional) 147 148 149 150 151 152 ### Path Parameters 153 154 This endpoint does not need any path parameter. 155 156 ### Other Parameters 157 158 Other parameters are passed through a pointer to a ListCredentialParams struct 159 160 161 Name | Type | Description 162 ------------- | ------------- | ------------- 163 **PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. 164 **Limit** | **int** | Max number of records to return. 165 166 ### Return type 167 168 [**[]ChatV2Credential**](ChatV2Credential.md) 169 170 ### Authorization 171 172 [accountSid_authToken](../README.md#accountSid_authToken) 173 174 ### HTTP request headers 175 176 - **Content-Type**: Not defined 177 - **Accept**: application/json 178 179 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 180 [[Back to Model list]](../README.md#documentation-for-models) 181 [[Back to README]](../README.md) 182 183 184 ## UpdateCredential 185 186 > ChatV2Credential UpdateCredential(ctx, Sidoptional) 187 188 189 190 191 192 ### Path Parameters 193 194 195 Name | Type | Description 196 ------------- | ------------- | ------------- 197 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 198 **Sid** | **string** | The SID of the Credential resource to update. 199 200 ### Other Parameters 201 202 Other parameters are passed through a pointer to a UpdateCredentialParams struct 203 204 205 Name | Type | Description 206 ------------- | ------------- | ------------- 207 **FriendlyName** | **string** | A descriptive string that you create to describe the resource. It can be up to 64 characters long. 208 **Certificate** | **string** | [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` 209 **PrivateKey** | **string** | [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` 210 **Sandbox** | **bool** | [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. 211 **ApiKey** | **string** | [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. 212 **Secret** | **string** | [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. 213 214 ### Return type 215 216 [**ChatV2Credential**](ChatV2Credential.md) 217 218 ### Authorization 219 220 [accountSid_authToken](../README.md#accountSid_authToken) 221 222 ### HTTP request headers 223 224 - **Content-Type**: application/x-www-form-urlencoded 225 - **Accept**: application/json 226 227 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 228 [[Back to Model list]](../README.md#documentation-for-models) 229 [[Back to README]](../README.md) 230